package com.huabo.audit.controller;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfig;

import com.hbfk.util.ImportOrExportExcelUtil;
import com.hbfk.util.JsonBean;
import com.hbfk.util.PropertyFileReader;
import com.hbfk.util.ResponseFormat;
import com.huabo.audit.oracle.entity.TblAuditOption;
import com.huabo.audit.oracle.entity.TblNbsjDoubtfulpointEntity;
import com.huabo.audit.oracle.entity.TblNbsjEntermeetingEntity;
import com.huabo.audit.oracle.entity.TblNbsjFactbookEntity;
import com.huabo.audit.oracle.entity.TblNbsjLeavemeetingEntity;
import com.huabo.audit.oracle.entity.TblNbsjProject;
import com.huabo.audit.oracle.entity.TblNbsjSheetEntity;
import com.huabo.audit.oracle.entity.TblNbsjWorkReportEntity;
import com.huabo.audit.oracle.vo.TBlNbsjSheetVo;
import com.huabo.audit.oracle.vo.TblNbsjDoubtfulpointVo;
import com.huabo.audit.oracle.vo.TblNbsjEntermeetingVo;
import com.huabo.audit.oracle.vo.TblNbsjFactbookVo;
import com.huabo.audit.oracle.vo.TblNbsjLeavemeetingVo;
import com.huabo.audit.oracle.vo.TblNbsjOperateVo;
import com.huabo.audit.oracle.vo.TblNbsjQuestionVo;
import com.huabo.audit.oracle.vo.TblNbsjWorkReportVo;
import com.huabo.audit.service.AttachmentService;
import com.huabo.audit.service.TblAttachmentService;
import com.huabo.audit.service.TblAuditOptionService;
import com.huabo.audit.service.TblNbsjDoubtfulpointService;
import com.huabo.audit.service.TblNbsjEntermeetingService;
import com.huabo.audit.service.TblNbsjFactbookService;
import com.huabo.audit.service.TblNbsjLeavemeetingService;
import com.huabo.audit.service.TblNbsjOperateService;
import com.huabo.audit.service.TblNbsjProjectService;
import com.huabo.audit.service.TblNbsjQuestionService;
import com.huabo.audit.service.TblNbsjQuestionaffirmService;
import com.huabo.audit.service.TblNbsjSheetService;
import com.huabo.audit.service.TblNbsjWorkReportService;
import com.huabo.audit.service.TblOrganizaService;
import com.huabo.audit.service.TblTargetTypeService;
import com.huabo.audit.service.UserService;
import com.huabo.audit.util.DateUtils;
import com.huabo.audit.util.FileUtil;
import com.huabo.audit.util.FreeMarkerUtil;
import com.huabo.audit.util.MD5Encrypt;
import com.huabo.audit.util.R;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

/**
 * 审计实施阶段
 */
@RestController
@Slf4j
@Api(value = "审计实施阶段", tags = { "审计实施阶段接口" })
@RequestMapping(value = "/auditImplement")
public class NbsjImplementController {

	@Resource
	public TblNbsjProjectService tblnbsjProjectService;

	@Resource
	public TblNbsjEntermeetingService tblNbsjEntermeetingService;

	@Resource
	public AttachmentService attachmentService;

	@Autowired
	public FreeMarkerConfig freeMarkerConfig;

	@Resource
	public TblNbsjLeavemeetingService tblNbsjLeavemeetingService;

	@Resource
	public TblTargetTypeService tblTargetTypeService;

	@Resource
	public TblNbsjSheetService tBlNbsjSheetService;

	@Resource
	public TblNbsjFactbookService tblNbsjFactbookService;

	@Resource
	public TblNbsjQuestionService tblNbsjQuestionService;

	@Resource
	public TblNbsjQuestionaffirmService tblNbsjQuestionaffirmService;

	@Resource
	public TblNbsjOperateService tblNbsjOperateService;

	@Resource
	public TblNbsjWorkReportService tblNbsjWorkReportService;
	
	@Resource
	public TblNbsjDoubtfulpointService tblNbsjDoubtfulpointService;
	
	@Resource
	public UserService userService;
	
	@Resource
	public TblOrganizaService tblOrganizaService;
	
	@Resource
	private TblAttachmentService tblAttachmentService;
	
	@Resource
	private TblAuditOptionService tblAuditOptionService;

	private static final String DOCDIC = PropertyFileReader.getItem("doc.path");

	/**
	 * 审计实施-进场纪要列表
	 */
	@GetMapping("/sjss/in_meet_record_list")
	@ApiOperation(value = "审计实施-进场纪要")
	public JsonBean in_meet_record_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjEntermeetingVo tblNbsjEntermeetingVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize,
			@ApiParam(name = "projectId", value = "", required = false) @RequestParam(value = "projectId", required = false) Integer projectId) {

		JsonBean jsonBean = null;
		try {
			if(null != projectId) {
				tblNbsjEntermeetingVo.setProgectid(projectId);
			}
			
			jsonBean = tblNbsjEntermeetingService.inMeetRecordListPageList(token, pageNumber, pageSize,tblNbsjEntermeetingVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 进场纪要-新增与修改
	 */
	@RequestMapping(value = "/sjss/in_meet_record_add", produces = "application/json; charset=utf-8", method = {RequestMethod.POST})
	@ApiOperation(value = "进场纪要-新增与修改")
    public JsonBean in_meet_record_add(HttpServletRequest request,@ApiParam(name="met",value="实体",required=true)TblNbsjEntermeetingEntity tblNbsjEntermeetingEntity,
			 @ApiParam(name="token",value="登录用户token",required=false) @RequestHeader("token")String token,
			 @ApiParam(name="attids",value="附件id数组",required=false)String attids)throws Exception{
		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblNbsjEntermeetingService.inMeetRecordAdd(tblNbsjEntermeetingEntity,token, attids);
		} catch (Exception e) {
			ResponseFormat.retParam(1,1000,e.getMessage());
		}
		return jsonBean;
    }
	/**
	 * 进场纪要-附件列表
	 */
    @GetMapping("/sjss/in_meet_record_file_list")
	@ApiOperation(value = "进场纪要-附件列表")
	public JsonBean in_meet_record_file_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "enterid", value = "业务主键", required = true) @RequestParam(value = "enterid", required = true) Integer enterid) {

		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblAttachmentService.inMeetRecordFileList(token,enterid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    /**
     * 进场纪要-附件删除
     */
    @GetMapping("/sjss/in_meet_record_file_del")
    @ApiOperation(value = "进场纪要-附件删除")
    public R in_meet_record_file_del(HttpServletRequest request, HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="attId",value="附件主键ID",required=true) @RequestParam("attId") String attId) throws Exception {
    	return this.tblNbsjEntermeetingService.removeAttInfoByAttId(token, attId);
    }

	/**
	 * 进场纪要-删除
	 */
	@GetMapping("/sjss/met_delete")
	@ApiOperation(value = "进场纪要-根据主键删除信息")
    public JsonBean met_delete(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="enterid",value="主键",required=true)@RequestParam(value = "enterid", required = true) Integer enterid) {
        
        try {
			return tblNbsjEntermeetingService.metDelete(enterid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	/**
	 * 进场纪要-明细
	 */
	@GetMapping("/sjss/in_meet_record_disp")
    @ApiOperation(value = "进场纪要-明细")
    public JsonBean in_meet_record_disp(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="enterid",value="主键",required=true)@RequestParam(value = "enterid", required = true) Integer enterid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tblNbsjEntermeetingService.findNbsjEntermeetingDetail(token,enterid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
	/**
	 * 进场纪要-作废
	 */
	@GetMapping("/sjss/met_cancel")
	@ApiOperation(value = "进场纪要-作废")
    public JsonBean met_cancel(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="enterid",value="主键",required=true)@RequestParam(value = "enterid", required = true) Integer enterid) {
        
        try {
			return tblNbsjEntermeetingService.metCalcel(enterid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
//	/**
//	 * 进场纪要-导出
//	 */
//	@GetMapping("/sjss/in_meet_record_export")
//	@ApiOperation(value = "进场纪要-导出")
//	public void in_meet_record_export(HttpServletRequest request, HttpServletResponse response,
//			@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
//			@ApiParam(name="enterid",value="进场纪要主键",required=true)@RequestParam(value = "enterid", required = true) String enterid) throws Exception {
//
//		TblNbsjEntermeetingEntity met= tblNbsjEntermeetingService.findEntityByEnterId(enterid);
//		Map<String, String> map = new HashMap<String,String>();
//		map.put("repdesc", met.getContent()==null?"":met.getContent());//内容
//		String FREEMARKER_PATH = request.getSession().getServletContext().getRealPath("/doc");
//		//String fileName =report.getReportname()+".doc";
//		String strname = MD5Encrypt.encrypByMd5(met.getEntername());
//		//加密文件
//		String fileName =strname+ DateUtils.dateToUnixTimestamp(DateUtils.getNowTime())+".doc";
//		  //中文文件
//		String filen = met.getEntername()+".doc";
//		Boolean flag =(Boolean)FreeMarkerUtil.htmlFileHasExist(request, FREEMARKER_PATH, fileName).get("exist");
//		fileName=new String(fileName.getBytes("utf-8"),"iso-8859-1");
//		if(!flag){//如何静态文件不存在，重新生成
//	        FreeMarkerUtil.createHtml(freeMarkerConfig, "static.ftl", request, map, FREEMARKER_PATH, fileName);//根据模板生成静态页面
//		}
//		String fileName1 = FREEMARKER_PATH +"/"+ fileName;
//		fileName1=new String(fileName1.getBytes("utf-8"),"iso-8859-1");
//		log.info("导出地址："+fileName1);
//		FileUtil.downLoad(fileName1, response, false, filen);
//		FileUtil.deleteFile(fileName1);
//	}


	
	/**
	 * 离场纪要列表
	 */
	@GetMapping("/sjss/out_meet_record_list")
	@ApiOperation(value = "离场纪要列表")
	public JsonBean out_meet_record_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjLeavemeetingVo tblNbsjLeavemeetingVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize,
			@ApiParam(name = "projectId", value = "", required = false) @RequestParam(value = "projectId", required = false) Integer projectId) {

		JsonBean jsonBean = null;
		try {
			
			if(null != tblNbsjLeavemeetingVo.getProgectid()) {
				
			}
			
			jsonBean = tblNbsjLeavemeetingService.outMeetRecordListPageList(token, pageNumber, pageSize,tblNbsjLeavemeetingVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 离场纪要-新增与修改
	 */
	@RequestMapping(value = "/sjss/out_meet_record_add", produces = "application/json; charset=utf-8", method = {RequestMethod.POST})
	@ApiOperation(value = "离场纪要-新增与修改")
    public JsonBean out_meet_record_add(HttpServletRequest request,@ApiParam(name="lev",value="实体",required=true)TblNbsjLeavemeetingEntity lev,
			 @ApiParam(name="token",value="登录用户token",required=false) @RequestHeader("token")String token,
			 @ApiParam(name="attids",value="附件id数组",required=false)String attids)throws Exception{
		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblNbsjLeavemeetingService.outMeetRecordAdd(lev,token,attids);
		} catch (Exception e) {
			ResponseFormat.retParam(1,1000,e.getMessage());
		}
		return jsonBean;
    }
	/**
	 * 离场纪要-附件列表
	 */
    @GetMapping("/sjss/out_meet_record_file_list")
	@ApiOperation(value = "离场纪要-附件列表")
	public JsonBean out_meet_record_file_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "leaveid", value = "业务主键", required = true) @RequestParam(value = "leaveid", required = true) Integer leaveid) {

		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblAttachmentService.outMeetRecordFileList(token,leaveid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    /**
     * 离场纪要-附件删除
     */
    @GetMapping("/sjss/out_meet_record_file_del")
    @ApiOperation(value = "离场纪要-附件删除")
    public R out_meet_record_file_del(HttpServletRequest request, HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="attId",value="附件主键ID",required=true) @RequestParam("attId") String attId) throws Exception {
    	return this.tblNbsjLeavemeetingService.removeAttInfoByAttId(token, attId);
    }
    
	/**
	 * 离场纪要-删除
	 */
	@GetMapping("/sjss/lev_delete")
	@ApiOperation(value = "离场纪要根据主键删除信息")
    public JsonBean lev_delete(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="leaveid",value="主键",required=true)@RequestParam(value = "leaveid", required = true) Integer leaveid) {
        
        try {
			return tblNbsjLeavemeetingService.outmetDelete(leaveid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	/**
	 * 离场纪要-明细
	 */
	@GetMapping("/sjss/out_meet_record_disp")
    @ApiOperation(value = "离场纪要-明细")
    public JsonBean out_meet_record_disp(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="leaveid",value="主键",required=true)@RequestParam(value = "leaveid", required = true) Integer leaveid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tblNbsjLeavemeetingService.findNbsjLeavemeetingDetail(token,leaveid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
	/**
	 * 离场纪要-作废
	 */
	@GetMapping("/sjss/out_met_cancel")
	@ApiOperation(value = "离场纪要-作废")
    public JsonBean out_met_cancel(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="leaveid",value="主键",required=true)@RequestParam(value = "leaveid", required = true) Integer leaveid) {
        
        try {
			return tblNbsjLeavemeetingService.outMetCalcel(leaveid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	/**
	 * 离场纪要-导出
	 */
	@GetMapping("/sjss/out_meet_record_export")
	@ApiOperation(value = " 离场纪要-导出")
	public void out_meet_record_export(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String id = request.getParameter("selectid");
        TblNbsjLeavemeetingEntity met = new TblNbsjLeavemeetingEntity();
		if (id != null) {
             met = tblNbsjLeavemeetingService.getById(id);
		}
		Map<String, String> map = new HashMap<String,String>();
		map.put("repdesc", met.getContent()==null?"":met.getContent());//内容
		String FREEMARKER_PATH = request.getSession().getServletContext().getRealPath("/WEB-INF/doc");
		//String fileName =report.getReportname()+".doc";
		String strname = MD5Encrypt.encrypByMd5(met.getLeavename());
		//加密文件
		String fileName =strname+ DateUtils.dateToUnixTimestamp(DateUtils.getNowTime())+".doc";
		  //中文文件
		String filen = met.getLeavename()+".doc";
		Boolean flag =(Boolean)FreeMarkerUtil.htmlFileHasExist(request, FREEMARKER_PATH, fileName).get("exist");
		fileName=new String(fileName.getBytes("utf-8"),"iso-8859-1");
		if(!flag){//如何静态文件不存在，重新生成
	        FreeMarkerUtil.createHtml(freeMarkerConfig, "static.ftl", request, map, FREEMARKER_PATH, fileName);//根据模板生成静态页面
		}
		String fileName1 = FREEMARKER_PATH +"/"+ fileName;
		fileName1=new String(fileName1.getBytes("utf-8"),"iso-8859-1");
//		logger.info("导出地址："+fileName1);
		FileUtil.downLoad(fileName1, response, false, filen);
		FileUtil.deleteFile(fileName1);
	}
	
	
	/**
	 * 我的任务清单列表
	 */
	@GetMapping("/sjss/check_list_my")
	@ApiOperation(value = "我的任务清单列表")
	public JsonBean check_list_my(HttpServletRequest request,
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjOperateVo tblNbsjOperateVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize) {

		JsonBean jsonBean = null;
		try {
			jsonBean = tblNbsjOperateService.checkListMyPageList(token, pageNumber, pageSize,tblNbsjOperateVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 我的任务-明细
	 */
	@GetMapping("/sjss/check_disp")
    @ApiOperation(value = "我的任务-明细")
    public JsonBean check_disp(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="programid",value="主键",required=true)@RequestParam(value = "programid", required = true) Integer programid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tblNbsjOperateService.checkListMyDetail(token, programid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
	/**
	 * 我的任务-完成
	 */
	@GetMapping("/sjss/check_final")
	@ApiOperation(value = "我的任务-完成")
    public JsonBean check_final(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="operateid",value="主键",required=true)@RequestParam(value = "operateid", required = true) Integer operateid,
    		@ApiParam(name="programId",value="主键",required=true)@RequestParam(value = "programId", required = true) Integer programId) {
        
        try {
			return tblNbsjOperateService.checkListFinal(operateid,programId, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	
	/**
	 * 工作日志列表
	 */
	@GetMapping("/nbsj/xmgl/workReportList")
	@ApiOperation(value = "工作日志列表")
	public JsonBean workReportList(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjWorkReportVo tblNbsjWorkReportVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize) {

		JsonBean jsonBean = null;
		try {
			jsonBean = tblNbsjWorkReportService.workReportPageList(token, pageNumber, pageSize,tblNbsjWorkReportVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 工作日志-新增与修改
	 */
	@RequestMapping(value = "/nbsj/xmgl/workReportSave", produces = "application/json; charset=utf-8", method = {RequestMethod.POST})
	@ApiOperation(value = "工作日志-新增与修改")
    public JsonBean workReportSave(HttpServletRequest request,@ApiParam(name="lev",value="实体",required=true)TblNbsjWorkReportEntity wr,
			 @ApiParam(name="token",value="登录用户token",required=false) @RequestHeader("token")String token,
			 @ApiParam(name="attids",value="附件id数组",required=false)String attids)throws Exception{
		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblNbsjWorkReportService.workReportAdd(wr,token,attids);
		} catch (Exception e) {
			ResponseFormat.retParam(1,1000,e.getMessage());
		}
		return jsonBean;
    }
	/**
	 * 工作日志-附件列表
	 */
    @GetMapping("/nbsj/xmgl/workReport_file_list")
	@ApiOperation(value = "工作日志-附件列表")
	public JsonBean workReport_file_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "reportid", value = "业务主键", required = true) @RequestParam(value = "reportid", required = true) Integer reportid) {

		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblAttachmentService.workReportFileList(token,reportid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    /**
     * 工作日志-附件删除
     */
    @GetMapping("/nbsj/xmgl/workReport_file_del")
    @ApiOperation(value = "工作日志-附件删除")
    public R workReport_file_del(HttpServletRequest request, HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="attId",value="附件主键ID",required=true) @RequestParam("attId") String attId) throws Exception {
    	return this.tblNbsjWorkReportService.removeAttInfoByAttId(token, attId);
    }
    
	/**
	 * 工作日志-删除
	 */
	@GetMapping("/nbsj/xmgl/workReportDelete")
	@ApiOperation(value = "工作日志-删除")
    public JsonBean workReportDelete(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="reportid",value="主键",required=true)@RequestParam(value = "reportid", required = true) Integer reportid) {
        
        try {
			return tblNbsjWorkReportService.workReportDelete(reportid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	/**
	 * 工作日志-明细
	 */
	@GetMapping("/nbsj/xmgl/workReportDetail")
    @ApiOperation(value = "工作日志-明细")
    public JsonBean workReportDetail(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="reportid",value="主键",required=true)@RequestParam(value = "reportid", required = true) Integer reportid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tblNbsjWorkReportService.findNbsjWorkReportDetail(token,reportid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
	
	
	/**
	 * 我的底稿列表
	 */
	@GetMapping("/sjss/project_standard_listdg")
	@ApiOperation(value = "我的底稿列表")
	public JsonBean project_standard_listdg(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TBlNbsjSheetVo tBlNbsjSheetVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize,
			@ApiParam(name = "projectId", value = "", required = false) @RequestParam(value = "projectId", required = false) Integer projectId) {

		JsonBean jsonBean = null;
		try {
			
			if(null != projectId) {
				tBlNbsjSheetVo.setProjectid(projectId);
			}
			jsonBean = tBlNbsjSheetService.projectStandardDgPageList(token, pageNumber, pageSize,tBlNbsjSheetVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 我的底稿-新增与修改
	 */
	@RequestMapping(value = "/sjss/project_standard_dg_add", produces = "application/json; charset=utf-8", method = {RequestMethod.POST})
	@ApiOperation(value = "我的底稿-新增与修改")
    public JsonBean project_standard_dg_add(HttpServletRequest request,@ApiParam(name="lev",value="实体",required=true)TblNbsjSheetEntity sheet,
			 @ApiParam(name="token",value="登录用户token",required=false) @RequestHeader("token")String token,
			 @ApiParam(name="attids",value="附件id数组",required=false)String attids,
			 @ApiParam(name="srJson",value="报告内容json",required=false)String srJson)throws Exception{
		JsonBean jsonBean = null;
		try {
			
//			srJson = "[{\"reportConcent\": \"报告错误内容1111111\", \"sjdeptIds\": \"198328,198334\" },"
//					+ "{\"reportConcent\": \"报告错误内容222222\", \"sjdeptIds\": \"198328\" }]";
			
			jsonBean = this.tBlNbsjSheetService.projectStandardDgAdd(sheet,token,attids,srJson);
		} catch (Exception e) {
			ResponseFormat.retParam(1,1000,e.getMessage());
		}
		return jsonBean;
    }
	/**
	 * 我的底稿-附件列表
	 */
    @GetMapping("/sjss/project_standard_dg_file_list")
	@ApiOperation(value = "我的底稿-附件列表")
	public JsonBean project_standard_dg_file_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "sheetid", value = "业务主键", required = true) @RequestParam(value = "sheetid", required = true) Integer sheetid) {

		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblAttachmentService.dgFileList(token,sheetid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    /**
     * 我的底稿-附件删除
     */
    @GetMapping("/sjss/project_standard_dg_file_del")
    @ApiOperation(value = "我的底稿-附件删除")
    public R project_standard_dg_file_del(HttpServletRequest request, HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="attId",value="附件主键ID",required=true) @RequestParam("attId") String attId) throws Exception {
    	return this.tBlNbsjSheetService.removeAttInfoByAttId(token, attId);
    }
    
	/**
	 * 我的底稿-删除（）
	 */
	@GetMapping("/sjss/project_standard_dg_del")
	@ApiOperation(value = "我的底稿-删除")
    public JsonBean project_standard_dg_del(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="sheetid",value="主键",required=true)@RequestParam(value = "sheetid", required = true) Integer sheetid) {
        
        try {
			return tBlNbsjSheetService.projectStandardDgDelete(sheetid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	/**
     * 我的底稿 详情
     */
    @GetMapping("/sjss/project_standard_dg_detail")
    @ApiOperation(value = "我的底稿--详情")
    public JsonBean project_standard_dg_detail(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="sheetid",value="主键",required=true)@RequestParam(value = "sheetid", required = true) Integer sheetid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tBlNbsjSheetService.findNbsjSheetDetail(token,sheetid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
    /**
     * 我的底稿-报告内容/问题描述-删除
     */
    @GetMapping("/sjss/sheet_report_del")
    @ApiOperation(value = "我的底稿-报告内容/问题描述-删除")
    public JsonBean sheet_report_del(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="reportid",value="主键",required=true)@RequestParam(value = "reportid", required = true) Integer reportid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tBlNbsjSheetService.sheetReportDel(token,reportid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
    

	/**
	 * 我的底稿-导出
	 */
	@GetMapping("/sjss/project_standard_dg_export")
	@ApiOperation(value = "我的底稿-导出")
	public void project_standard_dg_export(HttpServletRequest request, HttpServletResponse response,
										   @ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
										   @ApiParam(name="projectid",value="项目编号，非必填",required=false)@RequestParam(value = "projectid", required = false) Integer projectid) throws Exception {

		TblNbsjProject project = this.tblnbsjProjectService.getSSProjectDetail(token);
		if (projectid != null) {
			project = tblnbsjProjectService.getProjectById(projectid);
		}
		response.setContentType("application/binary;charset=UTF-8");
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try {
			response.setHeader("Content-disposition", "attachment; filename=" + new String("底稿管理".getBytes(), "iso-8859-1") + ".xlsx");// 组装附件名称和格式
			ServletOutputStream outputStream = response.getOutputStream();
			List<Object[]> objList1 = new ArrayList<Object[]>();
			List<TblNbsjSheetEntity> objList = tBlNbsjSheetService.OBJfindAllByProjectid(project.getProjectId(), token);
			for (int i = 0; i < objList.size(); i++) {
//            	TblNbsjSheetEntity ob = new TblNbsjSheetEntity();
				TblNbsjSheetEntity o = objList.get(i);
//                System.arraycopy(o,0,ob,0,14);
				List<TblAuditOption> optionByRelationId = tblAuditOptionService.findOptionByRelationId("");//(o[14].toString());
				BigDecimal bd = optionByRelationId.size() > 0 ? optionByRelationId.get(0).getOptStaffid() : new BigDecimal(0);
				String str1 = "";
				String str2 = "";
				if (optionByRelationId.size() == 1) {
					TblAuditOption ao = optionByRelationId.get(0);
					if (ao.getCreateDate() != null) {
						str1 += "复核人:" + ao.getStaffidName() + "  复核时间：" + sdf.format(ao.getCreateDate()) + "  状态：" + ao.getOptState() + "  意见：" + ao.getOptDesc() + "\n";// 复核时间："+ao.getCreateDate()+"
					} else {
						str1 += "复核人:" + ao.getStaffidName() + "  复核时间：    状态：" + ao.getOptState() + "  意见：" + ao.getOptDesc() + "\n";// 复核时间："+ao.getCreateDate()+"
					}

				}
				if (optionByRelationId.size() == 2) {
					TblAuditOption ao = optionByRelationId.get(0);
					if (ao.getCreateDate() != null) {
						str1 += "复核人:" + ao.getStaffidName() + "  复核时间：" + sdf.format(ao.getCreateDate()) + "  状态：" + ao.getOptState() + "  意见：" + ao.getOptDesc() + "\n";// 复核时间："+ao.getCreateDate()+"
					} else {
						str1 += "复核人:" + ao.getStaffidName() + "  复核时间：    状态：" + ao.getOptState() + "  意见：" + ao.getOptDesc() + "\n";// 复核时间："+ao.getCreateDate()+"
					}
					TblAuditOption ao1 = optionByRelationId.get(1);
					if (ao1.getCreateDate() != null) {
						str2 += "复核人:" + ao1.getStaffidName() + "  复核时间：" + sdf.format(ao1.getCreateDate()) + "  状态：" + ao1.getOptState() + "  意见：" + ao1.getOptDesc() + "\n";
					} else {
						str2 += "复核人:" + ao1.getStaffidName() + "  复核时间：    状态：" + ao1.getOptState() + "  意见：" + ao1.getOptDesc() + "\n";
					}

				}
				o.setYjfh(str2.equals("") ? "" : str2);
				o.setEjfh(str1.equals("") ? "" : str1);

				Object[] tempob = new Object[16];
				tempob[0] = o.getProjectName();
				tempob[1] = o.getSheetCode();
				tempob[2] = o.getSheetName();
				tempob[3] = o.getOrgname();
				tempob[4] = o.getBusinessAffiliation();
				tempob[5] = o.getApprover();
				tempob[6] = o.getTargetName();
				tempob[7] = o.getRiskLevel();
				tempob[8] = o.getTargetName();
				tempob[9] = o.getBusinessType();
				tempob[10] = o.getCreateTime();
				tempob[11] = o.getQuesTitle();
				tempob[12] = o.getSuditProcess();
				tempob[13] = o.getSjbwl();
				tempob[14] = o.getYjfh();
				tempob[15] = o.getEjfh();

				objList1.add(tempob);
			}
			//String[] titles = {"所属项目名称","底稿编号 ", "底稿名称", "审计目标 ", "被审计对象", "拟稿人", "拟稿日期","一级复核","二级复核"};
			String[] titles = {"所属项目名称", "底稿编号 ", "底稿名称", "被审计单位", "审计事项", "审计人员", " 审计目的", "是否发现问题", " 审计分项", " 业务单元",
					"底稿创建时间", "问题标题", "审计程序"/* ,"审计程序执行过程","审计发现","审计意见及建议" */, "审计备忘录", "一级复核", "二级复核"};
			ImportOrExportExcelUtil.exportExcel(titles, objList1, outputStream, null);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	/**
	 * 底稿汇总
	 */
	@GetMapping("/sjss/dg_listall")
	@ApiOperation(value = "底稿汇总列表")
	public JsonBean dgAllPageList(HttpServletRequest request, TBlNbsjSheetVo tBlNbsjSheetVo,
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize) {

		JsonBean jsonBean = null;
		try {
			jsonBean = tBlNbsjSheetService.dgAllPageList(token, pageNumber, pageSize,tBlNbsjSheetVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	
	/**
	 * 底稿管理列表
	 */
	@GetMapping("/sjss/dggl_list")
	@ApiOperation(value = "底稿管理列表")
	public JsonBean dggl_list(HttpServletRequest request, TBlNbsjSheetVo tBlNbsjSheetVo,
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize) {

		JsonBean jsonBean = null;
		try {
			jsonBean = tBlNbsjSheetService.dgglPageList(token, pageNumber, pageSize,tBlNbsjSheetVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
     * 底稿管理 详情
     */
    @GetMapping("/sjss/dggl_detail")
    @ApiOperation(value = "底稿管理--详情")
    public JsonBean dggl_detail(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="sheetid",value="主键",required=true)@RequestParam(value = "sheetid", required = true) Integer sheetid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tBlNbsjSheetService.findNbsjSheetDetail(token,sheetid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
    
    /**
	 * 审计发现列表
	 */
	@GetMapping("/xmzl/question_store_list")
	@ApiOperation(value = "审计发现列表")
	public JsonBean question_store_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjQuestionVo tblNbsjQuestionVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize,
			@ApiParam(name = "projectId", value = "", required = false) @RequestParam(value = "projectId", required = false) Integer projectId) {

		JsonBean jsonBean = null;
		try {
			jsonBean = tblNbsjQuestionService.questionStorePageList(token, pageNumber, pageSize,tblNbsjQuestionVo,projectId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 审计发现-发起整改
	 */
	@GetMapping("/sjzg/zgfp_fqStatus")
	@ApiOperation(value = "审计发现-发起整改")
    public JsonBean zgfp_fqStatus(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="questionid",value="主键",required=true)@RequestParam(value = "questionid", required = true) Integer questionid) {
        
        try {
			return tblNbsjQuestionService.questionStorePageFQZG(questionid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
//	/**
//	 * 审计发现-新增与修改
//	 */
//	@RequestMapping(value = "/xmzl/question_store_add", produces = "application/json; charset=utf-8", method = {RequestMethod.POST})
//	@ApiOperation(value = "审计发现-新增与修改")
//    public JsonBean question_store_add(HttpServletRequest request,@ApiParam(name="tnq",value="实体",required=true)TblNbsjQuestionDto tnq,
//			 @ApiParam(name="token",value="登录用户token",required=false) @RequestHeader("token")String token)throws Exception{
//		JsonBean jsonBean = null;
//		try {
//			jsonBean = this.tblNbsjQuestionService.questionStorePageAdd(tnq,token);
//		} catch (Exception e) {
//			ResponseFormat.retParam(1,1000,e.getMessage());
//		}
//		return jsonBean;
//    }
	/**
	 * 审计发现-删除
	 */
	@GetMapping("/xmzl/question_store_del")
	@ApiOperation(value = "审计发现-删除")
    public JsonBean question_store_del(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="questionid",value="主键",required=true)@RequestParam(value = "questionid", required = true) Integer questionid) {
        
        try {
			return tblNbsjQuestionService.questionStorePageDelete(questionid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	
	
	/**
	 * 事实确认书列表
	 */
	@GetMapping("/sjss/confirmation_list")
	@ApiOperation(value = "事实确认书列表")
	public JsonBean confirmation_list(HttpServletRequest request,
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjFactbookVo tblNbsjFactbookVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize,
			@ApiParam(name = "projectId", value = "", required = false) @RequestParam(value = "projectId", required = false) Integer projectId) {

		JsonBean jsonBean = null;
		try {
			
			if(null != projectId) {
				tblNbsjFactbookVo.setProjectid(projectId);
			}
			
			jsonBean = tblNbsjFactbookService.confirmationPageList(token, pageNumber, pageSize,tblNbsjFactbookVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 事实确认书-新增与修改
	 */
	@RequestMapping(value = "/sjss/confirmation_add", produces = "application/json; charset=utf-8", method = {RequestMethod.POST})
	@ApiOperation(value = "事实确认书-新增与修改")
    public JsonBean confirmation_add(HttpServletRequest request,@ApiParam(name="fb",value="实体",required=true)TblNbsjFactbookEntity fb,
			 @ApiParam(name="token",value="登录用户token",required=false) @RequestHeader("token")String token,
			 @ApiParam(name="questionIds",value="审计发现ids",required=false)String questionIds,
			 @ApiParam(name="attids",value="附件id数组",required=false)String attids)throws Exception{
		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblNbsjFactbookService.confirmationAdd(fb,token,questionIds,attids);
		} catch (Exception e) {
			ResponseFormat.retParam(1,1000,e.getMessage());
		}
		return jsonBean;
    }
	/**
	 * 事实确认书-附件列表
	 */
    @GetMapping("/sjss/confirmation_file_list")
	@ApiOperation(value = "事实确认书-附件列表")
	public JsonBean confirmation_file_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "factid", value = "业务主键", required = true) @RequestParam(value = "factid", required = true) Integer factid) {
		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblAttachmentService.confirmationFileList(token,factid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    /**
     * 事实确认书-附件删除
     */
    @GetMapping("/sjss/confirmation_file_del")
    @ApiOperation(value = "事实确认书-附件删除")
    public R confirmation_file_del(HttpServletRequest request, HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="attId",value="附件主键ID",required=true) @RequestParam("attId") String attId) throws Exception {
    	return this.tblNbsjFactbookService.removeAttInfoByAttId(token, attId);
    }
	
	/**
	 * 事实确认书-删除
	 */
	@GetMapping("/sjss/confirmation_del")
	@ApiOperation(value = "事实确认书-删除")
    public JsonBean confirmation_del(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="factid",value="主键",required=true)@RequestParam(value = "factid", required = true) Integer factid) {
        
        try {
			return tblNbsjFactbookService.confirmationDelete(factid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	/**
     * 事实确认书 详情
     */
    @GetMapping("/sjss/confirmation_detail")
    @ApiOperation(value = "事实确认书--详情")
    public JsonBean confirmation_detail(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="factid",value="主键",required=true)@RequestParam(value = "factid", required = true) Integer factid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tblNbsjFactbookService.findNbsjFactbookDetail(token,factid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
    /**
     * 事实确认书-新建修改-添加审计发现列表
     */
    @GetMapping("/sjss/confirmation_question_list")
	@ApiOperation(value = "事实确认书-新建修改-添加审计发现列表")
	public JsonBean confirmation_question_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjQuestionVo tblNbsjQuestionVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize,
			@ApiParam(name = "projectid", value = "", required = false) @RequestParam(value = "projectid", required = false) Integer projectid) {
		JsonBean jsonBean = null;
		try {
			tblNbsjQuestionVo.setStatus("1");
			jsonBean = tblNbsjQuestionService.confirmationQuestionStorePageList(token, pageNumber, pageSize,tblNbsjQuestionVo,projectid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    /**
     * 事实确认书-查询关联审计发现信息
     */
    @GetMapping("/sjss/confirmation_question_link")
	@ApiOperation(value = "事实确认书-查询关联审计发现信息")
	public JsonBean confirmation_question_link(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjQuestionVo tblNbsjQuestionVo,
			@ApiParam(name = "factid", value = "", required = false) @RequestParam(value = "factid", required = false) Integer factid) {
		JsonBean jsonBean = null;
		try {
			jsonBean = tblNbsjQuestionService.confirmationQuestionStoreLink(token, factid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	
	
	/**
	 * 疑点管理
	 */
	@GetMapping("/nkgj/dp/dp_list")
	@ApiOperation(value = "疑点管理列表")
	public JsonBean dp_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,TblNbsjDoubtfulpointVo tblNbsjDoubtfulpointVo,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize) {

		JsonBean jsonBean = null;
		try {
			jsonBean = tblNbsjDoubtfulpointService.dpPageList(token, pageNumber, pageSize,tblNbsjDoubtfulpointVo);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
	/**
	 * 疑点管理-新增与修改
	 */
	@RequestMapping(value = "/nkgj/dp_add", produces = "application/json; charset=utf-8", method = {RequestMethod.POST})
	@ApiOperation(value = "疑点管理-新增与修改")
    public JsonBean nkgj_projectdp_add(HttpServletRequest request,@ApiParam(name="dp",value="实体",required=true)TblNbsjDoubtfulpointEntity dp,
			 @ApiParam(name="token",value="登录用户token",required=false) @RequestHeader("token")String token,
			 @ApiParam(name="attids",value="附件id数组",required=false)String attids)throws Exception{
		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblNbsjDoubtfulpointService.dpAdd(dp,token,attids);
		} catch (Exception e) {
			ResponseFormat.retParam(1,1000,e.getMessage());
		}
		return jsonBean;
    }
	/**
	 * 疑点管理-附件列表
	 */
    @GetMapping("/nkgj/dp_file_list")
	@ApiOperation(value = "疑点管理-附件列表")
	public JsonBean dp_file_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "dpointid", value = "业务主键", required = true) @RequestParam(value = "dpointid", required = true) Integer dpointid) {

		JsonBean jsonBean = null;
		try {
			jsonBean = this.tblAttachmentService.dpFileList(token,dpointid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    /**
     * 疑点管理-附件删除
     */
    @GetMapping("/nkgj/dp_file_del")
    @ApiOperation(value = "疑点管理-附件删除")
    public R dp_file_del(HttpServletRequest request, HttpServletResponse response,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="attId",value="附件主键ID",required=true) @RequestParam("attId") String attId) throws Exception {
    	return this.tblNbsjDoubtfulpointService.removeAttInfoByAttId(token, attId);
    }
    
	/**
	 * 疑点管理-删除
	 */
	@GetMapping("/nkgj/dp_del")
	@ApiOperation(value = "疑点管理-删除")
    public JsonBean dp_del(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="dpointid",value="主键",required=true)@RequestParam(value = "dpointid", required = true) Integer dpointid) {
        
        try {
			return tblNbsjDoubtfulpointService.dpDelete(dpointid, token);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return null;
    }
	/**
     * 疑点管理 详情
     */
    @GetMapping("/nkgj/dp_detail")
    @ApiOperation(value = "疑点管理--详情")
    public JsonBean dp_detail(HttpServletRequest request,
    		@ApiParam(name="token",value="登录用户token",required=true) @RequestHeader("token")String token,
    		@ApiParam(name="dpointid",value="主键",required=true)@RequestParam(value = "dpointid", required = true) Integer dpointid) {
    	JsonBean jsonBean = null;
    	try {
			jsonBean = tblNbsjDoubtfulpointService.findDPDetail(token,dpointid);
		} catch (Exception e) {
			e.printStackTrace();
		}
        return jsonBean;
    }
    
    
    
    
    
    
    /**
     * 选择人员列表
     */
    @GetMapping("/user/user_list")//user/list
	@ApiOperation(value = "选择人员列表")
	public JsonBean user_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "pageNumber", value = "分页当前页数", required = false) @RequestParam(value = "pageNumber", required = false, defaultValue = "1") Integer pageNumber,
			@ApiParam(name = "pageSize", value = "每页记录数", required = false) @RequestParam(value = "pageSize", required = false, defaultValue = "15") Integer pageSize,
			@ApiParam(name = "orgid", value = "部门id", required = false) @RequestParam(value = "orgid", required = false) Integer orgid) {

		JsonBean jsonBean = null;
		try {
			jsonBean = userService.findAllPageBeanPid(token, pageNumber, pageSize,orgid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    
    /**
     * 选择公司列表
     */
    @GetMapping("/user/org_list")
	@ApiOperation(value = "选择公司列表")
	public JsonBean org_list(HttpServletRequest request, 
			@ApiParam(name = "token", value = "登录用户token", required = true) @RequestHeader("token") String token,
			@ApiParam(name = "pid", value = "父级部门id", required = false) @RequestParam(value = "pid", required = false) BigDecimal pid) {

		JsonBean jsonBean = null;
		try {
			jsonBean = tblOrganizaService.getOrgTreeListByAuditObj(token, pid);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return jsonBean;
	}
    


	
	/**
	 * 进场纪要-编号是否存在
	 *//*
		 * @RequestMapping(value = "/sjss/isnoteode") public @ResponseBody String
		 * sjss_isnoteode(HttpServletRequest request,HttpServletResponse response,
		 * TblNbsjEntermeetingEntity met) { String code =
		 * request.getParameter("projectCode"); TblNbsjProjectEntity project =
		 * this.tblnbsjProjectService.getSelectProject();
		 * List<TblNbsjEntermeetingEntity> list =
		 * tblNbsjEntermeetingService.isNoteCode(code,project.getProjectId().toString())
		 * ; if (list != null && list.size() > 0) { return "-1"; } response.reset();
		 * met.setCreatrtime(new Date()); met.setProject(project); String bodyinfo =
		 * request.getParameter("describe"); if (bodyinfo != null &&
		 * bodyinfo.trim().length() > 0) { met.setContent(bodyinfo); } TblStaff user =
		 * (TblStaff) request.getSession().getAttribute("longUser");
		 * met.setTblCreater(user);
		 * met.setStatus(TblNbsjEntermeetingEntity.NO_DEL.toString()); try { //保存附件
		 * String attids = request.getParameter("attids"); if
		 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
		 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
		 * attachmentService.findById(ids[i].trim()); met.getTblMetAtts().add(att); } }
		 * tblNbsjEntermeetingService.save(met); return met.getEnterid()+""; } catch
		 * (Exception e) { e.printStackTrace(); return "0"; }
		 * 
		 * } /** 进场纪要-保存
		 */
	/*
	 * @RequestMapping(value = "/sjss/sjtzs_save") public String
	 * sjss_save(HttpServletRequest request, TblNbsjEntermeetingEntity met) {
	 * met.setCreatrtime(new Date());
	 * met.setProject(tblnbsjProjectService.getSelectProject()); String bodyinfo =
	 * request.getParameter("describe"); if (bodyinfo != null &&
	 * bodyinfo.trim().length() > 0) { met.setContent(bodyinfo); } TblStaff user =
	 * (TblStaff) request.getSession().getAttribute("longUser");
	 * met.setTblCreater(user);
	 * met.setStatus(TblNbsjEntermeetingEntity.NO_DEL.toString());
	 * tblNbsjEntermeetingService.save(met); return
	 * "redirect:/nbsj/sjss/in_meet_record_modify?selectid=" + met.getEnterid(); }
	 * /** 进场纪要-修改 HYG 发布云端地址冲突
	 *
	 *//*
		 * @RequestMapping(value = "/sjss/in_meet_record_modify") public ModelAndView
		 * in_meet_record_modify(HttpServletRequest request) { String selectid =
		 * request.getParameter("selectid"); ModelAndView mv = new ModelAndView();
		 * mv.setViewName("nbsj/sjss/in_meet_record_modify"); if (selectid != null &&
		 * selectid.trim().length() > 0) { TblNbsjEntermeetingEntity met =
		 * tblNbsjEntermeetingService.getById(selectid); mv.addObject("met", met); }
		 * //查询框代码 String choiceSearch = request.getParameter("choiceSearch");
		 * if(choiceSearch == null || "".equals(choiceSearch)) { choiceSearch = "hide";
		 * } mv.addObject("choiceSearch",choiceSearch); return mv; } /** 进场纪要-添加附件
		 *
		 * @param file
		 * 
		 * @param request
		 * 
		 * @param projectid
		 * 
		 * @param session
		 * 
		 * @return
		 *//*
			 * @RequestMapping(value = "/sjss/nbsj_met_upload") public String
			 * nbsj_met_upload(MultipartFile file, HttpServletRequest request, String
			 * enterid, HttpSession session) { // logger.info("新建---添加附件");
			 * AttachmentService service = (AttachmentService)
			 * SpringContextHolder.getBean("AttachmentService"); TblStaff user = (TblStaff)
			 * session.getAttribute("longUser"); String fileName =
			 * file.getOriginalFilename(); long timeInMillis =
			 * Calendar.getInstance().getTimeInMillis(); String oldname =
			 * fileName.substring(0,fileName.lastIndexOf(".")); String
			 * newname=fileName.replace(oldname, timeInMillis+"jchyjl"); long size =
			 * file.getSize(); try { boolean flag = FtpUtil.uploadFile(newname,
			 * file.getInputStream()); if(flag){ // logger.info("上传成功"); }else{ //
			 * logger.info("上传失败"); } } catch (Exception e) { e.printStackTrace(); }
			 * TblAttachmentEntity a = new TblAttachmentEntity(); a.setAttname(fileName);
			 * TblNbsjEntermeetingEntity men = new TblNbsjEntermeetingEntity();
			 * men.setEnterid(new BigDecimal(enterid)); a.getTblAttMets().add(men);
			 * a.setAttpath(newname); a.setAttsize(new BigDecimal(size / 1024));
			 * a.setUploader(user.getUsername()); a.setUploadtime(new Date());
			 * service.add(a); return "redirect:in_meet_record_modify?selectid=" + enterid;
			 * } /** 进场纪要-删除附件
			 *
			 * @param request
			 * 
			 * @param projectid
			 * 
			 * @param attid
			 * 
			 * @return
			 *//*
				 * @RequestMapping(value = "/sjss/delete_met_upload") public String
				 * delete_met_upload(HttpServletRequest request, String enterid, String attid) {
				 * if (StringUtils.isNotBlank(attid)) { AttachmentService service =
				 * (AttachmentService) SpringContextHolder.getBean("AttachmentService");
				 * service.delete(attid); } return "redirect:in_meet_record_modify?selectid=" +
				 * enterid; } /** 进场纪要-修改-保存
				 *
				 * @param request
				 * 
				 * @param note
				 * 
				 * @return
				 *//*
					 * @RequestMapping(value = "/sjss/met_modify") public String
					 * met_modify(HttpServletRequest request) { String enterid =
					 * request.getParameter("enterid"); //查询框代码 String choiceSearch =
					 * request.getParameter("choiceSearch"); if(choiceSearch == null ||
					 * "".equals(choiceSearch)) { choiceSearch = "hide"; } if (enterid != null &&
					 * enterid.length() > 0) { TblNbsjEntermeetingEntity ment =
					 * tblNbsjEntermeetingService.getById(enterid); String entername =
					 * request.getParameter("entername"); String bodyinfo =
					 * request.getParameter("describe"); if (bodyinfo != null &&
					 * bodyinfo.trim().length() > 0) { ment.setContent(bodyinfo); }
					 * ment.setEntername(entername); //保存附件 String attids =
					 * request.getParameter("attids"); if (StringUtils.isNotBlank(attids)){ String[]
					 * ids = attids.split(","); for (int i = 0; i < ids.length; i++) {
					 * TblAttachmentEntity att = attachmentService.findById(ids[i].trim());
					 * ment.getTblMetAtts().add(att); } }
					 * tblNbsjEntermeetingService.saveOrUpdate(ment); return
					 * "redirect:/nbsj/sjss/in_meet_record_modify?selectid=" +
					 * enterid+"&choiceSearch="+choiceSearch; } else { return
					 * "redirect:/nbsj/sjss/in_meet_record_list?choiceSearch="+choiceSearch; } } /**
					 * 进场纪要-删除
					 *
					 * @param request
					 * 
					 * @return
					 *//*
						 * @RequestMapping(value = "/sjss/met_delete", produces =
						 * "application/json; charset=utf-8") public
						 * 
						 * @ResponseBody String met_delete(HttpServletRequest request) { String
						 * projectid = request.getParameter("projectid"); // logger.info("进场纪要--删除项目");
						 * if (projectid != null && projectid.length() > 0) { TblNbsjEntermeetingEntity
						 * met = tblNbsjEntermeetingService.getById(projectid);
						 * met.setStatus(TblNbsjEntermeetingEntity.YE_DEL.toString());
						 * tblNbsjEntermeetingService.saveOrUpdate(met); return JsonBean.success(); }
						 * else { return JsonBean.error("请选择删除的会议记录"); } } /** 进场纪要-查看
						 *
						 * @param request
						 * 
						 * @return
						 *//*
							 * @RequestMapping(value = "/sjss/in_meet_record_disp") public ModelAndView
							 * in_meet_record_disp(HttpServletRequest request) { String selectid =
							 * request.getParameter("selectid"); ModelAndView mv = new ModelAndView();
							 * mv.setViewName("nbsj/sjss/in_meet_record_disp"); if (selectid != null &&
							 * selectid.trim().length() > 0) { TblNbsjEntermeetingEntity met =
							 * tblNbsjEntermeetingService.getById(selectid); mv.addObject("met", met); }
							 * return mv; } /** 进场纪要--纪要内容--导出
							 * 
							 * @param request
							 * 
							 * @param response
							 * 
							 * @param reportid
							 * 
							 * @throws Exception
							 *//*
								 * @RequestMapping(value = "/sjss/in_meet_record_export") public void
								 * in_meet_record_export(HttpServletRequest request, HttpServletResponse
								 * response) throws Exception { String id = request.getParameter("selectid");
								 * TblNbsjEntermeetingEntity met=new TblNbsjEntermeetingEntity(); if (id !=
								 * null) { met = tblNbsjEntermeetingService.getById(id); } Map<String, String>
								 * map = new HashMap<String,String>(); map.put("repdesc",
								 * met.getContent()==null?"":met.getContent());//内容 String FREEMARKER_PATH =
								 * request.getSession().getServletContext().getRealPath("/WEB-INF/doc");
								 * //String fileName =report.getReportname()+".doc"; String strname =
								 * MD5Encrypt.encrypByMd5(met.getEntername()); //加密文件 String fileName =strname+
								 * DateUtils.dateToUnixTimestamp(DateUtils.getNowTime())+".doc"; //中文文件 String
								 * filen = met.getEntername()+".doc"; Boolean flag
								 * =(Boolean)FreeMarkerUtil.htmlFileHasExist(request, FREEMARKER_PATH,
								 * fileName).get("exist"); fileName=new
								 * String(fileName.getBytes("utf-8"),"iso-8859-1"); if(!flag){//如何静态文件不存在，重新生成
								 * FreeMarkerUtil.createHtml(freeMarkerConfig, "static.ftl", request, map,
								 * FREEMARKER_PATH, fileName);//根据模板生成静态页面 } String fileName1 = FREEMARKER_PATH
								 * +"/"+ fileName; fileName1=new
								 * String(fileName1.getBytes("utf-8"),"iso-8859-1"); //
								 * logger.info("导出地址："+fileName1); FileUtil.downLoad(fileName1, response, false,
								 * filen); FileUtil.deleteFile(fileName1); } /** 离场纪要-列表
								 *
								 * @return
								 *//*
									 * @RequestMapping(value = "/sjss/out_meet_record_list") public ModelAndView
									 * out_meet_record_list(HttpServletRequest request, String view,
									 * TblNbsjLeavemeetingEntity leave) { Integer pageNumber = 1; String number =
									 * request.getParameter("pageNumber"); String pstartDates =
									 * request.getParameter("pstartDates"); String pendDates =
									 * request.getParameter("pendDates"); if (number != null && number.length() > 0)
									 * { pageNumber = Integer.parseInt(number); } TblNbsjProjectEntity project =
									 * this.tblnbsjProjectService.getSelectProject(); String projectId =
									 * request.getParameter("projectId");
									 * 
									 * if (projectId != null&&projectId.length()>0) { project =
									 * tblnbsjProjectService.getById(projectId.toString()); } if (null != project) {
									 * pageBean = tblNbsjLeavemeetingService.findAll(leave, project.getProjectId(),
									 * pstartDates, pendDates, pageNumber, pageBean.getPageSize()); } else {
									 * pageBean = new PageBean(); } ModelAndView mv = new ModelAndView();
									 * mv.setViewName("nbsj/sjss/out_meet_record_list"); mv.addObject("pageBean",
									 * pageBean); mv.addObject("pstartDates", pstartDates);
									 * mv.addObject("pendDates", pendDates); mv.addObject("leave", leave);
									 * mv.addObject("fication", request.getParameter("fication"));//项目归档返回
									 * mv.addObject("projectId", projectId); mv.addObject("view", view); //查询框代码
									 * String choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch
									 * == null || "".equals(choiceSearch)) { choiceSearch = "hide"; }
									 * mv.addObject("choiceSearch",choiceSearch); return mv; } /** 离场纪要-添加
									 *
									 * @return
									 *//*
										 * @RequestMapping(value = "/sjss/out_meet_record_add") public ModelAndView
										 * out_meet_record_add(HttpServletRequest request) { ModelAndView mv = new
										 * ModelAndView(); mv.setViewName("nbsj/sjss/out_meet_record_add"); //查询框代码
										 * String choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch
										 * == null || "".equals(choiceSearch)) { choiceSearch = "hide"; }
										 * mv.addObject("choiceSearch",choiceSearch); return mv; } /** 离场纪要-编号是否存在
										 *
										 * @param request
										 * 
										 * @return
										 *//*
											 * @RequestMapping(value = "/sjss/leaveCode") public
											 * 
											 * @ResponseBody String sjss_leaveCode(HttpServletRequest request) { String
											 * code = request.getParameter("projectCode"); TblNbsjProjectEntity project
											 * = tblnbsjProjectService.getSelectProject();
											 * List<TblNbsjLeavemeetingEntity> list =
											 * tblNbsjLeavemeetingService.isNoteCode(code,project.getProjectId().
											 * toString()); if (list != null && list.size() > 0) { return list.size() +
											 * ""; } return "0"; } /** 离场纪要-保存
											 *
											 * @param request
											 * 
											 * @param note
											 * 
											 * @return
											 */
//    @RequestMapping(value = "/sjss/leave_save")
//    public String leave_save(HttpServletRequest request, TblNbsjLeavemeetingEntity leave) {
//        //保存附件
//        String attids = request.getParameter("attids");
//        if (StringUtils.isNotBlank(attids)){
//        	String[] ids = attids.split(",");
//        	for (int i = 0; i < ids.length; i++) {
//        		TblAttachmentEntity att = attachmentService.findById(ids[i].trim());
//        		leave.getTblLeaveAtts().add(att);
//        	}
//        }   
//        //查询框代码
//		String choiceSearch = request.getParameter("choiceSearch");
//		if(choiceSearch == null || "".equals(choiceSearch)) {
//			choiceSearch = "hide";
//		}
//        leave.setCreatrtime(new Date());
//        leave.setProject(tblnbsjProjectService.getSelectProject());
//        String bodyinfo = request.getParameter("describe");
//        if (bodyinfo != null && bodyinfo.trim().length() > 0) {
//            leave.setContent(bodyinfo);
//        }
//        TblStaff user = (TblStaff) request.getSession().getAttribute("longUser");
//        leave.setTblCreater(user);
//        leave.setStatus(TblNbsjLeavemeetingEntity.NO_DEL);
//        tblNbsjLeavemeetingService.save(leave);
//        return "redirect:/nbsj/sjss/out_meet_record_modify?selectid=" + leave.getLeaveid()+"&choiceSearch="+choiceSearch;
//    }
	/**
	 * 离场纪要-查看
	 *
	 * @return
	 */
	/*
	 * @RequestMapping(value = "/sjss/out_meet_record_disp") public ModelAndView
	 * out_meet_record_disp(HttpServletRequest request) { String selectid =
	 * request.getParameter("selectid"); ModelAndView mv = new ModelAndView(); if
	 * (selectid != null && selectid.trim().length() > 0) {
	 * TblNbsjLeavemeetingEntity leavemeeting =
	 * tblNbsjLeavemeetingService.get(selectid); mv.addObject("leave",
	 * leavemeeting); } mv.setViewName("nbsj/sjss/out_meet_record_disp"); return mv;
	 * } /** 离场纪要-修改
	 *
	 * @param request
	 * 
	 * @return
	 *//*
		 * @RequestMapping(value = "/sjss/out_meet_record_modify") public ModelAndView
		 * out_meet_record_modify(HttpServletRequest request) { String selectid =
		 * request.getParameter("selectid"); ModelAndView mv = new ModelAndView(); if
		 * (selectid != null && selectid.trim().length() > 0) {
		 * TblNbsjLeavemeetingEntity leavemeeting =
		 * tblNbsjLeavemeetingService.get(selectid); mv.addObject("leave",
		 * leavemeeting); } mv.setViewName("nbsj/sjss/out_meet_record_modify"); //查询框代码
		 * String choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch
		 * == null || "".equals(choiceSearch)) { choiceSearch = "hide"; }
		 * mv.addObject("choiceSearch",choiceSearch); return mv; }
		 *//**
			 * 离场纪要-修改-保存
			 *
			 * @param request
			 * @param note
			 * @return
			 */
	/*
	 * @RequestMapping(value = "/sjss/leave_modify") public String
	 * leave_modify(HttpServletRequest request) { String leaveid =
	 * request.getParameter("leaveid"); //查询框代码 String choiceSearch =
	 * request.getParameter("choiceSearch"); if (leaveid != null && leaveid.length()
	 * > 0) { TblNbsjLeavemeetingEntity leavemeeting =
	 * tblNbsjLeavemeetingService.get(leaveid); String leavename =
	 * request.getParameter("leavename"); String bodyinfo =
	 * request.getParameter("describe"); if (bodyinfo != null &&
	 * bodyinfo.trim().length() > 0) { leavemeeting.setContent(bodyinfo); } //保存附件
	 * String attids = request.getParameter("attids"); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i].trim());
	 * leavemeeting.getTblLeaveAtts().add(att); } }
	 * leavemeeting.setLeavename(leavename);
	 * tblNbsjLeavemeetingService.update(leavemeeting); return
	 * "redirect:/nbsj/sjss/out_meet_record_modify?selectid=" +
	 * leaveid+"&choiceSearch="+choiceSearch; } else { return
	 * "redirect:/nbsj/sjss/in_meet_record_list?choiceSearch="+choiceSearch; } }
	 *//**
		 * 离场纪要-删除
		 *
		 * @param request
		 * @return
		 */
	/*
	 * @RequestMapping(value = "/sjss/leave_delete", produces =
	 * "application/json; charset=utf-8") public
	 * 
	 * @ResponseBody String leave_delete(HttpServletRequest request) { String
	 * projectid = request.getParameter("projectid"); // logger.info("离场纪要--删除项目");
	 * if (projectid != null && projectid.length() > 0) { TblNbsjLeavemeetingEntity
	 * leavemeeting = tblNbsjLeavemeetingService.get(projectid);
	 * leavemeeting.setStatus(TblNbsjLeavemeetingEntity.YE_DEL);
	 * tblNbsjLeavemeetingService.update(leavemeeting); return JsonBean.success(); }
	 * else { return JsonBean.error("请选择删除的会议记录"); } } /** 离场纪要-添加附件
	 *
	 * @param file
	 * 
	 * @param request
	 * 
	 * @param projectid
	 * 
	 * @param session
	 * 
	 * @return
	 *//*
		 * @RequestMapping(value = "/sjss/nbsj_leave_upload") public String
		 * nbsj_leave_upload(MultipartFile file, HttpServletRequest request, String
		 * leaveid, HttpSession session) { // logger.info("新建---添加附件");
		 * AttachmentService service = (AttachmentService)
		 * SpringContextHolder.getBean("AttachmentService"); TblStaff user = (TblStaff)
		 * session.getAttribute("longUser"); String fileName =
		 * file.getOriginalFilename(); long timeInMillis =
		 * Calendar.getInstance().getTimeInMillis(); String oldname =
		 * fileName.substring(0,fileName.lastIndexOf(".")); String
		 * newname=fileName.replace(oldname, timeInMillis+"lchyjl"); long size =
		 * file.getSize(); try { boolean flag = FtpUtil.uploadFile(newname,
		 * file.getInputStream()); if(flag){ // logger.info("上传成功"); }else{ //
		 * logger.info("上传失败"); } } catch (Exception e) { e.printStackTrace(); }
		 * TblAttachmentEntity a = new TblAttachmentEntity(); a.setAttname(fileName);
		 * TblNbsjLeavemeetingEntity leave = new TblNbsjLeavemeetingEntity();
		 * leave.setLeaveid(new BigDecimal(leaveid)); a.getTblAttLeaves().add(leave);
		 * a.setAttpath(newname); a.setAttsize(new BigDecimal(size / 1024));
		 * a.setUploader(user.getUsername()); a.setUploadtime(new Date());
		 * service.add(a); return "redirect:/nbsj/sjss/out_meet_record_modify?selectid="
		 * + leaveid; }
		 *//**
			 * 离场纪要-删除附件
			 *
			 * @param request
			 * @param projectid
			 * @param attid
			 * @return
			 */
	/*
	 * @RequestMapping(value = "/sjss/delete_leave_upload") public String
	 * delete_leave_upload(HttpServletRequest request, String leaveid, String attid)
	 * { if (StringUtils.isNotBlank(attid)) { AttachmentService service =
	 * (AttachmentService) SpringContextHolder.getBean("AttachmentService");
	 * service.delete(attid); } return
	 * "redirect:/nbsj/sjss/out_meet_record_modify?selectid=" + leaveid; }
	 *//**
		 * 离场纪要--纪要内容--导出
		 * 
		 * @param request
		 * @param response
		 * @param reportid
		 * @throws Exception
		 */
	/*
	 * @RequestMapping(value = "/sjss/out_meet_record_export") public void
	 * out_meet_record_export(HttpServletRequest request, HttpServletResponse
	 * response) throws Exception { String id = request.getParameter("selectid");
	 * TblNbsjLeavemeetingEntity met = new TblNbsjLeavemeetingEntity(); if (id !=
	 * null) { met = tblNbsjLeavemeetingService.get(id); } Map<String, String> map =
	 * new HashMap<String,String>(); map.put("repdesc",
	 * met.getContent()==null?"":met.getContent());//内容 String FREEMARKER_PATH =
	 * request.getSession().getServletContext().getRealPath("/WEB-INF/doc");
	 * //String fileName =report.getReportname()+".doc"; String strname =
	 * MD5Encrypt.encrypByMd5(met.getLeavename()); //加密文件 String fileName =strname+
	 * DateUtils.dateToUnixTimestamp(DateUtils.getNowTime())+".doc"; //中文文件 String
	 * filen = met.getLeavename()+".doc"; Boolean flag
	 * =(Boolean)FreeMarkerUtil.htmlFileHasExist(request, FREEMARKER_PATH,
	 * fileName).get("exist"); fileName=new
	 * String(fileName.getBytes("utf-8"),"iso-8859-1"); if(!flag){//如何静态文件不存在，重新生成
	 * FreeMarkerUtil.createHtml(freeMarkerConfig, "static.ftl", request, map,
	 * FREEMARKER_PATH, fileName);//根据模板生成静态页面 } String fileName1 = FREEMARKER_PATH
	 * +"/"+ fileName; fileName1=new
	 * String(fileName1.getBytes("utf-8"),"iso-8859-1"); //
	 * logger.info("导出地址："+fileName1); FileUtil.downLoad(fileName1, response, false,
	 * filen); FileUtil.deleteFile(fileName1); }
	 * 
	 *//**
		 * 我的清单index
		 */
	/*
	 * @RequestMapping(value = "/sjss/index_check_list_my") public ModelAndView
	 * index_check_list_my(HttpServletRequest request) { ModelAndView mv = new
	 * ModelAndView(); TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); if (project != null) {
	 * if(project.getTemp()==null){ setErrorJsp("003",request);
	 * mv.setViewName("nbsj/main41"); }else{
	 * mv.setViewName("nbsj/sjss/index_check_list_my"); mv.addObject("tempId",
	 * project.getTemp().getTempleteId()); mv.addObject("projectId",
	 * project.getProjectId()); } } else { setErrorJsp("001",request);
	 * mv.setViewName("nbsj/main41"); } return mv; }
	 *//**
		 * 我的清单数量
		 */
	/*
	 * @RequestMapping(value = "/sjss/check_list_all_my") public ModelAndView
	 * check_list_all_my(BigDecimal projectId,HttpServletRequest request) {
	 * ModelAndView mv = new ModelAndView(); TblStaff tblStaff = (TblStaff)
	 * request.getSession().getAttribute("longUser"); Integer totalFinshCount = 0;//
	 * 完成数量 Integer totalSumCount = 0; // 总数 Integer totalSheetCount = 0;// 底稿数
	 * Integer totalUnFinshCount = 0;// 为完成数量 List<TblTargetTypeEntity> list =
	 * this.tblTargetTypeService.getNodeListByUser(projectId,
	 * tblStaff.getStaffid()); for (TblTargetTypeEntity tblTargetType : list) {
	 * totalFinshCount += tblTargetType.getFinshCount(); totalSumCount +=
	 * tblTargetType.getSumCount(); totalSheetCount +=
	 * tblTargetType.getSheetCount(); totalUnFinshCount +=
	 * tblTargetType.getUnFinshCount(); }
	 * mv.setViewName("nbsj/sjzj/check_list_all_my"); mv.addObject("list", list);
	 * mv.addObject("totalFinshCount", totalFinshCount);
	 * mv.addObject("totalSumCount", totalSumCount); mv.addObject("totalSheetCount",
	 * totalSheetCount); mv.addObject("totalUnFinshCount", totalUnFinshCount);
	 * return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/check_list_all") public ModelAndView
	 * check_list_all(BigDecimal projectId) { ModelAndView mv = new ModelAndView();
	 * Integer totalFinshCount = 0;// 完成数量 Integer totalSumCount = 0; // 总数 Integer
	 * totalSheetCount = 0;// 底稿数 Integer totalUnFinshCount = 0;// 为完成数量
	 * List<TblTargetTypeEntity> list =
	 * this.tblTargetTypeService.getNodeList(projectId); for (TblTargetTypeEntity
	 * tblTargetType : list) { totalFinshCount += tblTargetType.getFinshCount();
	 * totalSumCount += tblTargetType.getSumCount(); totalSheetCount +=
	 * tblTargetType.getSheetCount(); totalUnFinshCount +=
	 * tblTargetType.getUnFinshCount(); }
	 * mv.setViewName("nbsj/sjzj/check_list_all_my"); mv.addObject("list", list);
	 * mv.addObject("totalFinshCount", totalFinshCount);
	 * mv.addObject("totalSumCount", totalSumCount); mv.addObject("totalSheetCount",
	 * totalSheetCount); mv.addObject("totalUnFinshCount", totalUnFinshCount);
	 * return mv; }
	 * 
	 * @RequestMapping(value = "/xmzl/ssqrs_status_qr") public ModelAndView
	 * ssqrs_status_qr(HttpServletRequest request) { ModelAndView mv = new
	 * ModelAndView(); String sheetid = request.getParameter("sheetid");
	 * TblNbsjSheetEntity sheet = tBlNbsjSheetService.getById(new
	 * BigDecimal(sheetid)); String projectid = request.getParameter("projectid");
	 * TblNbsjProjectEntity project = tblnbsjProjectService.getById(projectid);
	 * String factid = request.getParameter("factid"); TblNbsjFactbookEntity
	 * factbook = tblNbsjFactbookService.geTblNbsjFactbook(factid); // 查询确认人意见
	 * TblNbsjQuestionEntity question =
	 * tblNbsjQuestionService.findNbsjQuestionBySheetId(sheetid);
	 * TblNbsjQuestionaffirmEntity questionaffirm =
	 * tblNbsjQuestionaffirmService.finNbsjQuestionaffirmByQuestionidAndFactid(
	 * factid, question.getQuestionId().toString());
	 * mv.setViewName("nbsj/wdcx/ssqrs_status_qr"); mv.addObject("sheet", sheet);
	 * mv.addObject("project", project); mv.addObject("factbook", factbook);
	 * mv.addObject("questionaffirm", questionaffirm); mv.addObject("question",
	 * question); return mv; }
	 * 
	 * @RequestMapping(value = "/xmzl/ssqrs_status") public
	 * 
	 * @ResponseBody String ssqrs_status(HttpServletRequest request) { String
	 * sheetid = request.getParameter("sheetId"); // String projectid =
	 * request.getParameter("projectid"); String factid =
	 * request.getParameter("factid"); String status =
	 * request.getParameter("status"); String describe =
	 * request.getParameter("describe"); String is = ""; try { if
	 * (sheetid!=null||!"".equals(sheetid)) { TblNbsjSheetEntity tBlNbsjSheet =
	 * tBlNbsjSheetService.getById(new BigDecimal(sheetid));
	 * tBlNbsjSheet.setStatus(1); tBlNbsjSheetService.saveOrUpdate(tBlNbsjSheet); }
	 * 
	 * TblNbsjQuestionEntity question =
	 * tblNbsjQuestionService.findNbsjQuestionBySheetId(sheetid);
	 * question.setStatus(Integer.parseInt(status));
	 * tblNbsjQuestionService.saveOrUpdate(question); TblNbsjQuestionaffirmEntity
	 * questionaffirm =
	 * tblNbsjQuestionaffirmService.finNbsjQuestionaffirmByQuestionidAndFactid(
	 * factid, question.getQuestionId().toString());
	 * questionaffirm.setDescribe(describe);
	 * tblNbsjQuestionaffirmService.updateTblNbsjQuestionaffirm(questionaffirm);
	 * TblNbsjFactbookEntity factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid);
	 * factbook.setStatus(factbook.STATUS_3);
	 * tblNbsjFactbookService.updateNbsjFactBook(factbook); is = "ok"; } catch
	 * (NumberFormatException e) { is = "no"; } return is; }
	 *//**
		 * 我的清单tree
		 */
	/*
	 * @RequestMapping(value = "/sjss/menu_left_tree_check_list_my") public
	 * ModelAndView menu_left_tree_check_list_my(BigDecimal projectId, BigDecimal
	 * tempId) { ModelAndView mv = new ModelAndView(); mv.addObject("projectId",
	 * projectId); mv.addObject("tempId", tempId);
	 * mv.setViewName("nbsj/sjss/menu_left_tree_check_list_my"); return mv; }
	 *//**
		 * 清单管理---tree
		 */
	/*
	 * @RequestMapping(value = "/sjss/getTree", produces =
	 * "application/json; charset=utf-8") public
	 * 
	 * @ResponseBody String sjss_gzjfindOrganizationByTree(BigDecimal nodeId, String
	 * type, BigDecimal tempId, BigDecimal projectId, HttpServletRequest request) {
	 * TblStaff tblStaff = (TblStaff) request.getSession().getAttribute("longUser");
	 * String url = ""; boolean all = false; String mainUrl = ""; if
	 * (StringUtils.isNotBlank(type)) { switch (type) { // 我的清单 case "my": url =
	 * "/nbsj/sjss/check_list_my?1=1"; mainUrl = "/nbsj/sjss/check_list_all_my?1=1";
	 * break; // 清单管理 case "all": url = "/nbsj/sjss/check_list_my_all?1=1"; mainUrl
	 * = "/nbsj/sjss/check_list_all?1=1"; all = true; break; default: break; } } if
	 * (null == nodeId) { List<Tree> tree =
	 * this.tblTargetTypeService.getRoot(tempId, mainUrl); return
	 * JSONObject.toJSONString(tree); } else { List<Tree> list = null;
	 * TblTargetTypeEntity tblTargetType = tblTargetTypeService.getById(nodeId); if
	 * (all) { list = this.tblTargetTypeService.getTree(nodeId, tempId, url); } else
	 * { if (tblTargetType.getParentId() == null) { list =
	 * this.tblTargetTypeService.getTreeByUser(tempId, projectId,
	 * tblStaff.getStaffid(), url); } else { list =
	 * this.tblTargetTypeService.getTreeByUser(nodeId, tempId, projectId,
	 * tblStaff.getStaffid(), url); } }
	 * System.out.println(JSONObject.toJSONString(list)); return
	 * JSONObject.toJSONString(list); } }
	 *//**
		 * 我的清单列表
		 */
	/*
	 * @RequestMapping(value = "/sjss/check_list_my") public ModelAndView
	 * check_list_my(Integer targetId, Integer projectId, Integer pageNumber,
	 * HttpServletRequest request) { ModelAndView mv = new ModelAndView(); TblStaff
	 * tblStaff = (TblStaff) request.getSession().getAttribute("longUser"); String
	 * bsunitname = request.getParameter("bsunitname"); pageBean =
	 * this.tblNbsjOperateService.findPorgramByUser(targetId, projectId,
	 * tblStaff.getStaffid().intValue(), pageNumber,
	 * pageBean.getPageSize(),bsunitname); // pageBean =
	 * this.tblAduitProGramService.getProgramByUser(targetId, // projectId,
	 * tblStaff.getStaffid(), pageNumber, // pageBean.getPageSize());
	 * mv.addObject("pageBean", pageBean); mv.addObject("targetId", targetId);
	 * mv.addObject("projectId", projectId);
	 * mv.addObject("backLink",request.getQueryString() );
	 * mv.setViewName("nbsj/sjss/check_list_my"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/check_list_my_all") public ModelAndView
	 * check_list_my_all(Integer targetId, Integer projectId, Integer pageNumber,
	 * HttpServletRequest request) { ModelAndView mv = new ModelAndView(); pageBean
	 * = this.tblNbsjOperateService.findPorgram(targetId, projectId, pageNumber,
	 * pageBean.getPageSize()); // pageBean =
	 * this.tblAduitProGramService.getProgramByUser(targetId, // projectId,
	 * tblStaff.getStaffid(), pageNumber, // pageBean.getPageSize());
	 * mv.addObject("pageBean", pageBean); mv.addObject("targetId", targetId);
	 * mv.addObject("projectId", projectId); mv.addObject("fication",
	 * request.getParameter("fication"));//项目归档返回
	 * mv.setViewName("nbsj/sjss/check_list_my_all"); return mv; }
	 * 
	 * @RequestMapping(value="/work/workreport") public ModelAndView
	 * workReport(HttpServletRequest request,Integer
	 * pageNumber,TblNbsjWorkReportEntity tnwr){ ModelAndView mv = new
	 * ModelAndView("nbsj/xmgl/workReportList"); TblNbsjProjectEntity selectProject
	 * = tblnbsjProjectService.getSelectProject(); if (null != selectProject) { try
	 * { if(pageNumber == null){ pageNumber = 1; } PageInfo<TblNbsjWorkReportEntity>
	 * pageInfo = new PageInfo<TblNbsjWorkReportEntity>();
	 * 
	 * TblOrganization attribute = (TblOrganization)
	 * request.getSession().getAttribute("hbOrgEntity");// 选则的机构 //TblStaff tblStaff
	 * = (TblStaff) request.getSession().getAttribute("longUser"); //TblStaff
	 * deptFzrStaff = tblStaffService.findByRole("稽核部负责人",attribute.getOrgid());
	 * //只查看当前项目的工作日志 tnwr.setProjectId(selectProject);
	 * tnwr.setTblOrganization(attribute); String reportTime =
	 * request.getParameter("reporttime1"); if(reportTime != null &&
	 * !"".equals(reportTime)){ tnwr.setReporttime(DateUtils.parse(reportTime,
	 * "yyyy-MM-dd")); } // 可以查看管理的人员,稽核部负责人和项目负责人 //List<BigDecimal> list =
	 * tblStaffService.findTaskControlPerson(selectProject.getProjectid(),attribute.
	 * getOrgid()); // 当前登陆用户 if (!list.contains(tblStaff.getStaffid())) {
	 * tnwr.setReporter(tblStaff); } pageInfo.setCondition(tnwr);
	 * pageInfo.setCurrentPage(pageNumber);
	 * tblNbsjWorkReportService.findWorkReportListByPageInfo(pageInfo);
	 * request.getSession().setAttribute("UETempType", "gzrz"); //查询框代码 String
	 * choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch == null
	 * || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); mv.addObject("reportnameCX",
	 * tnwr.getReportname()); mv.addObject("reporttypeCX", tnwr.getReporttype());
	 * mv.addObject("reportTimeCX", reportTime); mv.addObject("pageInfo", pageInfo);
	 * mv.addObject("xmfzr",selectProject.getTblPm().getStaffid()); } catch
	 * (Exception e) { e.printStackTrace(); } }else { setErrorJsp("001",request);
	 * mv.setViewName("nbsj/main41"); } return mv; }
	 * 
	 * @RequestMapping(value="/work/toAddWorkReport") public ModelAndView
	 * toAddWorkReport(HttpServletRequest request,Integer
	 * pageNumber,TblNbsjWorkReportEntity tnwr){ ModelAndView mv = new
	 * ModelAndView("nbsj/xmgl/workReportAdd"); //查询框代码 String choiceSearch =
	 * request.getParameter("choiceSearch"); if(choiceSearch == null ||
	 * "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 * @RequestMapping(value="/work/workReportsave")
	 * 
	 * @ResponseBody public Integer workReportsave(HttpServletRequest request,String
	 * reportname,String reporttype,String reportmode,String memo,String describe){
	 * Integer result = 0; try { Integer count =
	 * this.tblNbsjWorkReportService.findWorkReportByName(reportname); if(count >
	 * 0){ result = 2; }else{ TblOrganization attribute = (TblOrganization)
	 * request.getSession().getAttribute("hbOrgEntity");// 选则的机构
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * TblNbsjWorkReportEntity tnwr = new TblNbsjWorkReportEntity();
	 * tnwr.setProjectId(project); tnwr.setTblOrganization(attribute); String
	 * staffid = request.getParameter("staffid"); String orgid =
	 * request.getParameter("oid"); TblStaff staff = new TblStaff();
	 * staff.setStaffid(new BigDecimal(staffid)); TblOrganization org = new
	 * TblOrganization(); org.setOrgid(new BigDecimal(orgid));
	 * tnwr.setReporter(staff); tnwr.setReportdepartment(org);
	 * tnwr.setReportname(reportname); tnwr.setReporttype(reporttype);
	 * tnwr.setReportmode(reportmode); tnwr.setMemo(memo);
	 * tnwr.setRepdesc(describe);
	 * tnwr.setReporttime(DateUtils.parse(request.getParameter("reporttime1"),
	 * "yyyy-MM-dd")); //保存附件 String attids = request.getParameter("attids"); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i].trim()); tnwr.getTblAttachments().add(att);
	 * } } this.tblNbsjWorkReportService.save(tnwr); result =
	 * Integer.parseInt(tnwr.getReportid().toString()); } } catch (Exception e) {
	 * result = -1; } return result; }
	 * 
	 * @RequestMapping(value="/work/workReportToUpdate") public ModelAndView
	 * workReportToUpdate(HttpServletRequest request,String id){ ModelAndView mv =
	 * new ModelAndView("nbsj/xmgl/workReportUpdate"); try { TblNbsjWorkReportEntity
	 * tnwr = this.tblNbsjWorkReportService.getById(new BigDecimal(id)); //查询框代码
	 * String choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch
	 * == null || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); mv.addObject("report",tnwr); }
	 * catch (Exception e) { e.printStackTrace(); } return mv; }
	 * 
	 * @RequestMapping(value="/work/workReportToShow") public ModelAndView
	 * workReportToShow(HttpServletRequest request,String id){ ModelAndView mv = new
	 * ModelAndView("nbsj/xmgl/workReportShow"); try { TblNbsjWorkReportEntity tnwr
	 * = this.tblNbsjWorkReportService.getById(new BigDecimal(id));
	 * mv.addObject("report",tnwr); } catch (Exception e) { e.printStackTrace(); }
	 * return mv; }
	 * 
	 * @RequestMapping(value = "/work/delfj",produces =
	 * "application/json;charset=utf-8") public @ResponseBody String
	 * delfj(HttpServletRequest request, String attid) { // logger.info("审计报告删除底稿");
	 * try { String reportid = request.getParameter("reportid");
	 * TblNbsjWorkReportEntity tnwr = this.tblNbsjWorkReportService.getById(new
	 * BigDecimal(reportid)); TblAttachmentEntity att =
	 * attachmentService.findById(attid); tnwr.getTblAttachments().remove(att);
	 * this.tblNbsjWorkReportService.merge(tnwr);
	 * this.tblNbsjWorkReportService.executeDeleteFj(att); } catch (Exception e) {
	 * e.printStackTrace(); return JsonBean.error(); } return JsonBean.success(); }
	 * 
	 * @RequestMapping(value = "/work/report_upload") public String
	 * report_upload(MultipartFile file, HttpServletRequest request) {
	 * AttachmentService service1 = (AttachmentService)
	 * SpringContextHolder.getBean("AttachmentService"); TblStaff user = (TblStaff)
	 * request.getSession().getAttribute("longUser"); String fileName =
	 * file.getOriginalFilename(); long timeInMillis =
	 * Calendar.getInstance().getTimeInMillis(); String oldname =
	 * fileName.substring(0,fileName.lastIndexOf(".")); String
	 * newname=fileName.replace(oldname, timeInMillis+"bg"); long size =
	 * file.getSize(); try { boolean flag = FtpUtil.uploadFile(newname,
	 * file.getInputStream()); if(flag){ // logger.info("上传成功"); }else{ //
	 * logger.info("上传失败"); } } catch (Exception e) { e.printStackTrace(); }
	 * TblAttachmentEntity a = new TblAttachmentEntity(); a.setAttname(fileName);
	 * a.setAttpath(newname); a.setAttsize(new BigDecimal( size / 1024));
	 * a.setUploader(user.getUsername()); a.setUploadtime(new Date());
	 * service1.add(a); String id = request.getParameter("reportid"); if(id!=null &&
	 * id.trim().length()>0){ TblNbsjWorkReportEntity tnwr =
	 * this.tblNbsjWorkReportService.getById(new BigDecimal(id));
	 * tnwr.getTblAttachments().add(a); this.tblNbsjWorkReportService.merge(tnwr); }
	 * return "redirect:/nbsj/work/workReportToUpdate?id=" + id; }
	 * 
	 * @RequestMapping(value = "/work/workReportUpdateSave") public String
	 * workReportUpdateSave(HttpServletRequest request) { String id =
	 * request.getParameter("reportid"); TblNbsjWorkReportEntity tnwr =
	 * this.tblNbsjWorkReportService.getById(new BigDecimal(id));
	 * tnwr.setReportname(request.getParameter("reportname")); SimpleDateFormat
	 * formatter = new SimpleDateFormat("yyyy-MM-dd"); try {
	 * tnwr.setReporttime((formatter.parse((request.getParameter("reporttime1")))));
	 * } catch (ParseException e) { e.printStackTrace(); } String describe =
	 * request.getParameter("describe"); tnwr.setRepdesc(describe);
	 * tnwr.setReporttype(request.getParameter("reporttype")); String
	 * memo=request.getParameter("memo"); tnwr.setMemo(memo);
	 * tnwr.setReportmode(request.getParameter("reportmode"));
	 * 
	 * TblStaff staff = new TblStaff(); staff.setStaffid(new
	 * BigDecimal(request.getParameter("staffid"))); tnwr.setReporter(staff);
	 * 
	 * TblOrganization org = new TblOrganization(); org.setOrgid(new
	 * BigDecimal(request.getParameter("oid"))); tnwr.setReportdepartment(org);
	 * 
	 * //保存附件 String attids = request.getParameter("attids"); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i].trim()); tnwr.getTblAttachments().add(att);
	 * } } tnwr.setReportfile(request.getParameter("reportfile"));
	 * this.tblNbsjWorkReportService.merge(tnwr); //查询框代码 String choiceSearch =
	 * request.getParameter("choiceSearch"); if(choiceSearch == null ||
	 * "".equals(choiceSearch)) { choiceSearch = "hide"; } //return
	 * workReportToUpdate(request,tnwr.getReportid().toString());//跳转至修改页 return
	 * "redirect:/nbsj/work/workReportToUpdate?id=" +
	 * id+"&choiceSearch="+choiceSearch; }
	 * 
	 * @RequestMapping(value = "/work/deleteWorkReport")
	 * 
	 * @ResponseBody public String deleteWorkReport(HttpServletRequest
	 * request,String ids) { String[] rids = ids.split(","); try { for (int i = 0; i
	 * < rids.length; i++) { TblNbsjWorkReportEntity tnwr =
	 * this.tblNbsjWorkReportService.getById(new BigDecimal(rids[i]));
	 * this.tblNbsjWorkReportService.delete(tnwr); } } catch (Exception e) {
	 * e.printStackTrace(); } return "0"; }
	 * 
	 *//**
		 * 审计实施-我的底稿
		 */
	/*
	 * @RequestMapping(value = "/sjss/project_standard_listdg") public ModelAndView
	 * project_standard_listdg(HttpServletRequest request) { TblNbsjProjectEntity
	 * project = this.tblnbsjProjectService.getSelectProject(); ModelAndView mv =
	 * new ModelAndView(); if (project != null) { TblStaff tblStaff = (TblStaff)
	 * request.getSession().getAttribute("longUser"); String page =
	 * request.getParameter("pageNumber"); Integer pageNumber=1; if(page!=null &&
	 * page.trim().length()>0) { pageNumber=Integer.parseInt(page); } String number
	 * = request.getParameter("num"); String name = request.getParameter("name");
	 * String state = request.getParameter("state"); String pmid=
	 * request.getParameter("pmid"); String staffname1=
	 * request.getParameter("staffname1"); TblNbsjSheetEntity sheet = new
	 * TblNbsjSheetEntity(); if (number != null && number != "") {
	 * sheet.setSheetCode(number); } if (name != null && name != "") {
	 * sheet.setSheetName(name); } if (state != null && state != "") {
	 * sheet.setState(Integer.parseInt(state)); } if (pmid != null && pmid != "") {
	 * TblStaff staff = userService.findById(pmid); sheet.setCreateStaff(staff); }
	 * if(project.getTblPm().getStaffid().toString().equals(tblStaff.getStaffid().
	 * toString())){ pageBean =
	 * this.tBlNbsjSheetService.findByProjectIdAndPmUserId(sheet,
	 * project.getProjectid(), pageNumber, pageBean.getPageSize());
	 * mv.addObject("pageBean", pageBean); }else{ pageBean =
	 * this.tBlNbsjSheetService.findByProjectIdAndUserId(sheet,
	 * project.getProjectid(), tblStaff.getStaffid(), pageNumber,
	 * pageBean.getPageSize()); mv.addObject("pageBean", pageBean); } pageBean =
	 * this.tBlNbsjSheetService.findByProjectIdAndUserId(sheet,
	 * project.getProjectId(), tblStaff.getStaffid(), pageNumber,
	 * pageBean.getPageSize()); mv.addObject("pageBean", pageBean); String
	 * identifier = ""; try { identifier =
	 * activityPluginsService.getoNState(ProcessEnum.SJ_DGFH.name()); } catch
	 * (Exception e) { e.printStackTrace(); } mv.addObject("identifier",identifier);
	 * mv.addObject("number", number); mv.addObject("name", name);
	 * mv.addObject("laststate", state); mv.addObject("pmidCX", pmid);
	 * mv.addObject("staffname1CX", staffname1);
	 * mv.setViewName("nbsj/sjss/project_standard_list"); } else {
	 * setErrorJsp("001",request); mv.setViewName("nbsj/main41"); } //查询框代码 String
	 * choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch == null
	 * || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 *//**
		 * 工作底稿
		 */
	/*
	 * @RequestMapping(value = "/sjss/project_standard_list") public ModelAndView
	 * project_standard_list(Integer pageNumber, HttpServletRequest request) {
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * ModelAndView mv = new ModelAndView(); if (project != null) { TblStaff
	 * tblStaff = (TblStaff) request.getSession().getAttribute("longUser"); String
	 * number = request.getParameter("num"); String name =
	 * request.getParameter("name"); String state = request.getParameter("state");
	 * String pmid= request.getParameter("pmid"); String staffname1=
	 * request.getParameter("staffname1"); TblNbsjSheetEntity sheet = new
	 * TblNbsjSheetEntity(); if (number != null && number != "") {
	 * sheet.setSheetCode(number); } if (name != null && name != "") {
	 * sheet.setSheetName(name); } if (state != null && state != "") {
	 * sheet.setState(Integer.parseInt(state)); } if (pmid != null && pmid != "") {
	 * TblStaff staff = userService.findById(pmid); sheet.setCreateStaff(staff); }
	 * if(project.getTblPm().getStaffid().toString().equals(tblStaff.getStaffid().
	 * toString())){ pageBean =
	 * this.tBlNbsjSheetService.findByProjectIdAndPmUserId(sheet,
	 * project.getProjectId(), pageNumber, pageBean.getPageSize());
	 * mv.addObject("pageBean", pageBean); }else{ pageBean =
	 * this.tBlNbsjSheetService.findByProjectIdAndUserId(sheet,
	 * project.getProjectId(), tblStaff.getStaffid(), pageNumber,
	 * pageBean.getPageSize()); mv.addObject("pageBean", pageBean); }
	 * 
	 * String identifier = ""; try { identifier =
	 * activityPluginsService.getoNState(ProcessEnum.SJ_DGFH.name()); } catch
	 * (Exception e) { e.printStackTrace(); } mv.addObject("identifier",identifier);
	 * mv.addObject("number", number); mv.addObject("name", name);
	 * mv.addObject("laststate", state); mv.addObject("pmidCX", pmid);
	 * mv.addObject("staffname1CX", staffname1);
	 * mv.setViewName("nbsj/sjss/project_standard_listgl"); } else {
	 * setErrorJsp("001",request); mv.setViewName("nbsj/main41"); } //查询框代码 String
	 * choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch == null
	 * || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 *//**
		 * 查看工作底稿
		 */
	/*
	 * @RequestMapping(value = "/sjss/project_standard_view") public ModelAndView
	 * project_standard_view(Integer pageNumber, BigDecimal spid,HttpServletRequest
	 * request) { ModelAndView mv = new ModelAndView(); try { String dhz =
	 * request.getParameter("dhz"); TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); TblNbsjSheetEntity sheet =
	 * this.tBlNbsjSheetService.getById(spid); List<TblAttachmentEntity> fj =
	 * attachmentService.findAllByTblNBSJSheet(spid.toString());
	 * List<TblNbsjSheetReportEntity> tnsrList =
	 * tblNbsjSheetReportService.findReportListBySheet(spid.toString());
	 * mv.addObject("fj", fj); mv.addObject("sheet", sheet); mv.addObject("project",
	 * project); mv.addObject("dhz", dhz); mv.addObject("tnsrList", tnsrList);
	 * mv.addObject("ckpe", request.getParameter("ckpe"));
	 * mv.setViewName("nbsj/sjss/pmp_audit_project_view"); } catch (Exception e) {
	 * e.printStackTrace(); } return mv; }
	 *//**
		 * @Des: 审计 工作底稿--审批
		 */
	/*
	 * @RequestMapping(value = "/sjss/to_sp_dggl") public ModelAndView
	 * to_sp_dggl(HttpServletRequest request,BigDecimal spid) { ModelAndView mv =
	 * new ModelAndView(); try { TblNbsjSheetEntity sheet =
	 * this.tBlNbsjSheetService.getById(spid); String tId =
	 * request.getParameter("tId"); if(StringUtils.isNotBlank(tId) &&
	 * sheet.getState() != TblNbsjSheetEntity.STATE5){ List<String> btnList =
	 * processService.getButtonsForTransition(tId); mv.addObject("btnList",btnList);
	 * } String cyId = request.getParameter("cyId"); if
	 * (StringUtils.isNotBlank(cyId)){ TblCirculation cy =
	 * tblCirculationService.get(cyId); mv.addObject("cy",cy); }
	 * List<TblAuditOption> ao = tblAuditOptionService.findOptionByRelationId(spid);
	 * mv.addObject("sheet",sheet); mv.addObject("ao",ao); mv.addObject("tId",tId);
	 * mv.addObject("v",request.getParameter("v")); List<TblAttachmentEntity> fj =
	 * attachmentService.findAllByTblNBSJSheet(spid.toString());
	 * List<TblNbsjSheetReportEntity> tnsrList =
	 * tblNbsjSheetReportService.findReportListBySheet(spid.toString());
	 * TblNbsjProjectEntity project = tblnbsjProjectService.findBySheetid(spid);
	 * mv.addObject("project",project); mv.addObject("tnsrList",tnsrList);
	 * mv.addObject("fj", fj); mv.addObject("spid", spid);
	 * mv.setViewName("nbsj/sjss/sj_dggl_sp"); } catch (Exception e) {
	 * e.printStackTrace(); } return mv; }
	 *//**
		 * 工作底稿
		 */
	/*
	 * @RequestMapping(value = "/sjss/project_standard_listall") public ModelAndView
	 * project_standard_listall(Integer pageNumber, String view,HttpServletRequest
	 * request) { TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); String projectId =
	 * request.getParameter("projectId");
	 * 
	 * if (projectId != null&&projectId.length()>0) { project =
	 * tblnbsjProjectService.getById(projectId.toString()); } ModelAndView mv = new
	 * ModelAndView(); if (project != null) { // pageBean =
	 * this.tBlNbsjSheetService.findByProjectId(project.getProjectid(), pageNumber,
	 * pageBean.getPageSize()); // mv.addObject("pageBean", pageBean); //
	 * mv.addObject("view", view); mv.setViewName("nbsj/sjss/dg_index");
	 * mv.addObject("projectId", projectId); mv.addObject("view", "view");
	 * mv.addObject("ckpe", request.getParameter("ckpe")); //
	 * mv.setViewName("nbsj/sjss/project_standard_listall"); } else {
	 * setErrorJsp("001",request); mv.setViewName("nbsj/main41"); } return mv; }
	 * 
	 *//**
		 * 底稿汇总
		 * 
		 * @param request
		 * @return
		 */
	/*
	 * @RequestMapping(value = "/sjss/dg_userleft") public ModelAndView
	 * dg_userleft(HttpServletRequest request) { TblOrganization organization =
	 * (TblOrganization) request.getSession().getAttribute("hbOrgEntity");
	 * ModelAndView mv = new ModelAndView("nbsj/sjss/dg_userleft"); String projectId
	 * = request.getParameter("projectId"); mv.addObject("orgid",
	 * organization.getOrgid()); mv.addObject("treeName",
	 * organization.getOrgname()); String type = request.getParameter("type");
	 * mv.addObject("projectId", projectId); mv.addObject("ckpe",
	 * request.getParameter("ckpe")); mv.addObject("view",
	 * request.getParameter("view")); mv.addObject("type", type); return mv; }
	 * 
	 * @RequestMapping(value = "/wthz/findOrganizationByTreeAll", produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * findOrganizationByTrees(BigDecimal nodeId, String type, HttpServletRequest
	 * request) { TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); String projectId =
	 * request.getParameter("projectId"); if (projectId !=
	 * null&&projectId.length()>0) { project =
	 * tblnbsjProjectService.getById(projectId.toString()); } if (null == nodeId) {
	 * TblOrganization organization = (TblOrganization)
	 * request.getSession().getAttribute("hbOrgEntity"); nodeId =
	 * organization.getOrgid(); if (project != null) {
	 * if(project.getTblnbsjorgs().getOrgid()!=null &&
	 * project.getTblnbsjorgs().getOrgtype()==0){ TblOrganization org =
	 * organizationService.findByFatharidAndCommpy(project.getTblnbsjorgs().
	 * getFatherorgid().toString()); if(org!=null){ nodeId =org.getOrgid(); }
	 * 
	 * }else if(project.getTblnbsjstaffs()!=null &&
	 * project.getTblnbsjstaffs().getTblOrganization().getOrgtype()==0){
	 * TblOrganization org = organizationService.findByFatharidAndCommpy(
	 * project.getTblnbsjstaffs().getTblOrganization().getFatherorgid().toString());
	 * if(org!=null){ nodeId =org.getOrgid(); } }else
	 * if(project.getTblnbsjorgs().getOrgid()!=null &&
	 * project.getTblnbsjstaffs()==null){
	 * nodeId=project.getTblnbsjorgs().getOrgid(); }else {
	 * nodeId=project.getTblnbsjstaffs().getTblOrganization().getOrgid(); } }
	 * 
	 * }
	 * 
	 * 
	 * String json = ""; if (StringUtils.isNotBlank(type)) { List<Tree> list =
	 * this.tblOrganizaService.getTree(nodeId); json =
	 * JSONObject.toJSONString(list); } else { List<Tree> list =
	 * this.tblOrganizaService.getNodeAll(nodeId); json =
	 * JSONObject.toJSONString(list); } return json; }
	 *//**
		 * 底稿汇总
		 */
	/*
	 * @RequestMapping(value = "/sjss/dg_listall") public ModelAndView
	 * dg_listall(Integer pageNumber, String view,HttpServletRequest request,String
	 * sheetCode,String sheetName ) { TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); String projectId =
	 * request.getParameter("projectId"); if (projectId !=
	 * null&&projectId.length()>0) { project =
	 * tblnbsjProjectService.getById(projectId.toString()); } TblStaff tblStaff =
	 * (TblStaff) request.getSession().getAttribute("longUser");
	 * 
	 * String orgid =request.getParameter("orgid"); if(orgid==null || orgid==""){
	 * orgid=tblStaff.getTblOrganization().getOrgid().toString();
	 * if(project.getTblnbsjorgs()!=null){ orgid
	 * =project.getTblnbsjorgs().getOrgid().toString(); }else
	 * if(project.getTblnbsjstaffs()!=null){ orgid =
	 * project.getTblnbsjstaffs().getTblOrganization().getOrgid().toString(); } }
	 * ModelAndView mv = new ModelAndView(); if (project != null) { // pageBean =
	 * this.tBlNbsjSheetService.findByProjectId(project.getProjectid(), pageNumber,
	 * pageBean.getPageSize()); //pageBean =
	 * this.tBlNbsjSheetService.findByOrgId(new BigDecimal(orgid), pageNumber,
	 * pageBean.getPageSize(),sheetCode, sheetName); //修改为 pageBean =
	 * this.tBlNbsjSheetService.findByOrgId(new BigDecimal(orgid), pageNumber,
	 * pageBean.getPageSize(),sheetCode, sheetName,project.getProjectId());
	 * mv.addObject("pageBean", pageBean); mv.addObject("orgid", orgid);
	 * mv.addObject("view", view); mv.addObject("projectId", projectId);
	 * mv.addObject("project", project); mv.addObject("ckpe",
	 * request.getParameter("ckpe")); mv.addObject("fication",
	 * request.getParameter("fication"));//项目归档返回 mv.addObject("sheetCodeCX",
	 * sheetCode);// mv.addObject("sheetNameCX", sheetName);//
	 * mv.setViewName("nbsj/sjss/project_standard_listall"); } else {
	 * setErrorJsp("001",request); mv.setViewName("nbsj/main41"); } //查询框代码 String
	 * choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch == null
	 * || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 *//**
		 * 底稿汇总
		 */
	/*
	 * @RequestMapping(value = "/sjss/dg_listallByOrg") public ModelAndView
	 * dg_listallByOrg(Integer pageNumber, String view,HttpServletRequest
	 * request,String sheetCode,String sheetName ) { String projectId =
	 * request.getParameter("projectId"); TblStaff tblStaff = (TblStaff)
	 * request.getSession().getAttribute("longUser"); TblOrganization organization =
	 * (TblOrganization) request.getSession().getAttribute("hbOrgEntity");
	 * 
	 * String orgid =request.getParameter("orgid"); if(orgid==null || orgid==""){
	 * orgid=organization.getOrgid().toString(); if(project.getTblnbsjorgs()!=null){
	 * orgid =project.getTblnbsjorgs().getOrgid().toString(); }else
	 * if(project.getTblnbsjstaffs()!=null){ orgid =
	 * project.getTblnbsjstaffs().getTblOrganization().getOrgid().toString(); } }
	 * ModelAndView mv = new ModelAndView(); // pageBean =
	 * this.tBlNbsjSheetService.findByProjectId(project.getProjectid(), pageNumber,
	 * pageBean.getPageSize()); pageBean =
	 * this.tBlNbsjSheetService.findByOrgIdBysql(new BigDecimal(orgid), pageNumber,
	 * pageBean.getPageSize(),sheetCode, sheetName); //修改为 //pageBean =
	 * this.tBlNbsjSheetService.findByOrgId(new BigDecimal(orgid), pageNumber,
	 * pageBean.getPageSize(),sheetCode, sheetName,project.getProjectid());
	 * mv.addObject("pageBean", pageBean); mv.addObject("orgid", orgid);
	 * mv.addObject("view", view); mv.addObject("projectId", projectId);
	 * mv.addObject("ckpe", request.getParameter("ckpe")); mv.addObject("fication",
	 * request.getParameter("fication"));//项目归档返回 mv.addObject("sheetCodeCX",
	 * sheetCode);// mv.addObject("sheetNameCX", sheetName);//
	 * mv.setViewName("nbsj/sjss/project_standard_listallByOrg"); //查询框代码 String
	 * choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch == null
	 * || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/gzdg_export") public
	 * 
	 * @ResponseBody String gzdg_export(HttpServletRequest request,
	 * HttpServletResponse response) { TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); String projectId =
	 * request.getParameter("projectId"); if (projectId !=
	 * null&&projectId.length()>0) { project =
	 * tblnbsjProjectService.getById(projectId.toString()); } TblStaff user =
	 * (TblStaff) request.getSession().getAttribute("longUser");
	 * response.setContentType("application/binary;charset=UTF-8"); SimpleDateFormat
	 * sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { //String fileName =
	 * new String(("底稿管理").getBytes()); //String a = URLEncoder.encode(fileName +
	 * ".xlsx", "UTF-8") response.setHeader("Content-disposition",
	 * "attachment; filename=" + new String("底稿管理".getBytes(),"iso-8859-1") +
	 * ".xlsx");// 组装附件名称和格式 ServletOutputStream outputStream =
	 * response.getOutputStream(); List<Object[]> objList1 = new
	 * ArrayList<Object[]>(); List<Object[]> objList
	 * =tBlNbsjSheetService.OBJfindAllByProjectid(project.getProjectId().toString(),
	 * user.getStaffid()); for (int i = 0;i<objList.size();i++) { Object[] ob = new
	 * Object[16]; Object[] o = objList.get(i); System.arraycopy(o,0,ob,0,14);
	 * List<TblAuditOption> optionByRelationId =
	 * tblAuditOptionService.findOptionByRelationId(new BigDecimal((char[]) o[14]));
	 * BigDecimal bd
	 * =optionByRelationId.size()>0?optionByRelationId.get(0).getOptStaffid(): new
	 * BigDecimal(0); String str1 = ""; String str2 = "";
	 * if(optionByRelationId.size()==1) { TblAuditOption ao =
	 * optionByRelationId.get(0); if(ao.getCreateDate()!=null){ str1 +=
	 * "复核人:"+ao.getStaffidName()+"  复核时间："+sdf.format(ao.getCreateDate())+"  状态："
	 * +ao.getOptState()+"  意见："+ ao.getOptDesc()+"\n";//
	 * 复核时间："+ao.getCreateDate()+" }else{ str1 +=
	 * "复核人:"+ao.getStaffidName()+"  复核时间：    状态："+ao.getOptState()+"  意见："+
	 * ao.getOptDesc()+"\n";// 复核时间："+ao.getCreateDate()+" }
	 * 
	 * } if(optionByRelationId.size()==2) { TblAuditOption ao =
	 * optionByRelationId.get(0); if(ao.getCreateDate()!=null){ str1 +=
	 * "复核人:"+ao.getStaffidName()+"  复核时间："+sdf.format(ao.getCreateDate())+"  状态："
	 * +ao.getOptState()+"  意见："+ ao.getOptDesc()+"\n";//
	 * 复核时间："+ao.getCreateDate()+" }else{ str1 +=
	 * "复核人:"+ao.getStaffidName()+"  复核时间：    状态："+ao.getOptState()+"  意见："+
	 * ao.getOptDesc()+"\n";// 复核时间："+ao.getCreateDate()+" } TblAuditOption ao1 =
	 * optionByRelationId.get(1); if(ao1.getCreateDate()!=null){ str2 +=
	 * "复核人:"+ao1.getStaffidName()+"  复核时间："+sdf.format(ao1.getCreateDate())+"  状态："
	 * +ao1.getOptState()+"  意见："+ ao1.getOptDesc()+"\n"; }else{ str2 +=
	 * "复核人:"+ao1.getStaffidName()+"  复核时间：    状态："+ao1.getOptState()+"  意见："+
	 * ao1.getOptDesc()+"\n"; }
	 * 
	 * } ob[14] = str2.equals("")?"":str2; ob[15] = str1.equals("")?"":str1;
	 * objList1.add(ob); } //String[] titles = {"所属项目名称","底稿编号 ", "底稿名称", "审计目标 ",
	 * "被审计对象", "拟稿人", "拟稿日期","一级复核","二级复核"}; String[] titles = { "所属项目名称", "底稿编号 ",
	 * "底稿名称", "被审计单位", "审计事项", "审计人员", " 审计目的", "是否发现问题", " 审计分项", " 业务单元",
	 * "底稿创建时间", "问题标题", "审计程序" ,"审计程序执行过程","审计发现","审计意见及建议"
	 * ,"审计备忘录","一级复核","二级复核"}; ImportOrExportExcelUtil.exportExcel(titles,
	 * objList1, outputStream, null); } catch (Exception e) { e.printStackTrace(); }
	 * return null; }
	 *//**
		 * 工作底稿--新建
		 */
	/*
	 * @RequestMapping(value = "/sjss/pmp_audit_project_digao") public ModelAndView
	 * pmp_audit_project_digao(HttpServletRequest request, BigDecimal sheetid,
	 * BigDecimal operateId) { ModelAndView mv = new ModelAndView(); try {
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * TblNbsjSheetEntity sheet = null;
	 *//**
		 * if (null != operateId) { TblNbsjOperate operate =
		 * this.tblNbsjOperateService.get(operateId); sheet =
		 * operate.getNbsjSheet()==null?new TBlNbsjSheet():operate.getNbsjSheet();
		 * if(sheet.getAuditDesc()==null || sheet.getAuditDesc().equals("")){
		 * if(operate.getAuthorization() != null &&
		 * operate.getAuthorization().getAduitProGram() != null){
		 * sheet.setAuditDesc(operate.getAuthorization().getAduitProGram().getSuditProcess());
		 * } } }
		 */
	/*
	 * if (sheetid != null) { sheet = tBlNbsjSheetService.getById(sheetid);
	 * List<TblAttachmentEntity> fj =
	 * attachmentService.findAllByTblNBSJSheet(sheetid.toString());
	 * List<TblNbsjSheetReportEntity> tnsrList =
	 * tblNbsjSheetReportService.findReportListBySheet(sheetid.toString());
	 * mv.addObject("fj", fj); mv.addObject("tnsrList",tnsrList);
	 * 
	 * } else{ if(sheet!=null && sheet.getSheetId()!=null){ List<TblAttachment> fj =
	 * attachmentService.findAllByTblNBSJSheet(sheet.getSheetId().toString());
	 * mv.addObject("fj", fj); } }
	 * 
	 * mv.addObject("sheet", sheet); String backUrl =
	 * request.getParameter("backUrl"); mv.addObject("project", project);
	 * mv.addObject("operateId", operateId); mv.addObject("type",
	 * request.getParameter("type")); mv.addObject("modelTye",
	 * request.getParameter("type")); mv.addObject("backUrl",
	 * request.getParameter("backUrl")); mv.addObject("backLink",
	 * request.getParameter("backLink")); mv.addObject("dg",
	 * request.getParameter("dg")); mv.addObject("abc",
	 * "${project.tblnbsjorgs.orgname}"); if (backUrl != null &&
	 * backUrl.trim().length() > 0) {
	 * mv.setViewName("cz/dg/pmp_audit_project_digao"); } else {
	 * mv.setViewName("nbsj/sjss/pmp_audit_project_digao"); } } catch (Exception e)
	 * { e.printStackTrace(); } //查询框代码 String choiceSearch =
	 * request.getParameter("choiceSearch"); if(choiceSearch == null ||
	 * "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 *//**
		 * 保存工作底稿
		 */
	/*
	 * @RequestMapping(value = "/sjss/pmp_audit_project_digao_save", produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * pmp_audit_project_digao_save(TblNbsjSheetEntity blNbsjSheet, BigDecimal
	 * operateId, HttpServletRequest request,HttpServletResponse response,
	 * 
	 * @RequestParam(value="reportConcent",required=false)String[]
	 * reportContent,@RequestParam(value="sjdeptIds",required=false)String[]
	 * sjdeptIds,
	 * 
	 * @RequestParam(value="reportid",required=false)String[] reportid,String[]
	 * sjdeptNames) { TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); TblStaff tblStaff = (TblStaff)
	 * request.getSession().getAttribute("longUser"); response.reset();
	 * //由审计程序生成的底稿引用审计程序的的审计分项、业务单元、审计程序，或者新建的底稿自行填写 //TblAduitProGram program =
	 * tblAduitProGramService.findProgramByOperateID(operateId); if (null !=
	 * blNbsjSheet.getSheetId()) { TblNbsjSheetEntity sheet =
	 * this.tBlNbsjSheetService.getById(blNbsjSheet.getSheetId());
	 * blNbsjSheet.setCreateTime(sheet.getCreateTime());
	 * blNbsjSheet.setState(sheet.getState()); blNbsjSheet.setCreateStaff(tblStaff);
	 * blNbsjSheet.setUpdateTime(new Date()); blNbsjSheet.setProject(project);
	 * blNbsjSheet.setApprover(sheet.getApprover()); //将审计项目中的被审计单位添加到底稿表中，部门或者人员
	 * blNbsjSheet.setOrganization(project.getTblnbsjorgs());
	 * blNbsjSheet.setTblnbsjstaffs(project.getTblnbsjstaffs());
	 * blNbsjSheet.setQuestions(sheet.getQuestions());// 审计发现
	 * blNbsjSheet.setTblAttachments(sheet.getTblAttachments());// 附件
	 * blNbsjSheet.setRiskLevel(blNbsjSheet.getRiskLevel()); //新建底稿
	 * blNbsjSheet.setTargetId(sheet.getTargetId()); if(operateId!=null) {
	 * blNbsjSheet.setTargetId(operateId.intValue()); } //保存附件 String attids =
	 * request.getParameter("attids"); if (StringUtils.isNotBlank(attids)){ String[]
	 * ids = attids.split(","); for (int i = 0; i < ids.length; i++) {
	 * TblAttachmentEntity att = attachmentService.findById(ids[i].trim());
	 * blNbsjSheet.getTblAttachments().add(att); } }
	 * tBlNbsjSheetService.merge(blNbsjSheet); try {
	 * 
	 * if(null!=sjdeptIds&&reportContent.length==0) { return
	 * JsonBean.error("请填写报告内容/问题描述！"); } String bg_save =
	 * this.bg_save(reportContent, sjdeptIds, reportid,
	 * sjdeptNames,blNbsjSheet);//保存底稿报告内容 JSONObject userJson =
	 * JSONObject.parseObject(bg_save); JsonBean bgjson =
	 * JSON.toJavaObject(userJson,JsonBean.class); if("1".equals(bgjson)) { return
	 * bg_save; } } catch (Exception e) { e.printStackTrace(); return
	 * JsonBean.error("保存失败！"); } return
	 * JsonBean.success(blNbsjSheet.getSheetId().toString()); } else { boolean exist
	 * = this.tBlNbsjSheetService.getSheetByCode(project.getProjectId(),
	 * blNbsjSheet.getSheetCode()); if (!exist) { //底稿未添加时，不能新增报告
	 * if(reportContent!=null&&blNbsjSheet.getSheetId()==null) { return
	 * JsonBean.error("请先保存底稿基本信息，再新增报告内容！"); } //新建底稿 if(operateId!=null) {
	 * blNbsjSheet.setTargetId(operateId.intValue()); }
	 * blNbsjSheet.setCreateStaff(tblStaff); blNbsjSheet.setCreateTime(new Date());
	 * blNbsjSheet.setState(1);//新建--未审批状态 blNbsjSheet.setProject(project);
	 * //将审计项目中的被审计单位添加到底稿表中 blNbsjSheet.setOrganization(project.getTblnbsjorgs());
	 * blNbsjSheet.setTblnbsjstaffs(project.getTblnbsjstaffs());
	 * //blNbsjSheet.setOrganization(request.getParameter("planmadeorg"));
	 * Serializable serializable = this.tBlNbsjSheetService.save(blNbsjSheet);
	 * //保存附件 String attids = request.getParameter("attids"); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i].trim());
	 * blNbsjSheet.getTblAttachments().add(att); } } TblNbsjSheetEntity sheet =
	 * this.tBlNbsjSheetService.getById(new BigDecimal(serializable.toString()));
	 * String bg_save = this.bg_save(reportContent, sjdeptIds, reportid,
	 * sjdeptNames,blNbsjSheet);//保存底稿报告内容,可以为空 JSONObject userJson =
	 * JSONObject.parseObject(bg_save); JsonBean bgjson =
	 * JSON.toJavaObject(userJson,JsonBean.class); if("1".equals(bgjson)) { return
	 * bg_save; } TblNbsjQuestionEntity question = new TblNbsjQuestionEntity();
	 * question.setNbsjSheet(sheet);
	 * question.setStatus(TblNbsjQuestionEntity.NUSTATUS);
	 * question.setGroupStatus(TblNbsjQuestionEntity.GROUPNO);
	 * this.tblNbsjQuestionService.save(question); return
	 * JsonBean.success(serializable.toString()); } else { return
	 * JsonBean.error("编号已存在！"); } } }
	 *//**
		 * 保存工作底稿的报告（ajax保存）
		 */
	/*
	 * public String bg_save(String[] reportContent,String[] sjdeptIds,String[]
	 * reportid,String[] sjdeptNames,TblNbsjSheetEntity sheet) {
	 * TblNbsjSheetReportEntity tnsr = null; try {
	 * if(reportContent.length<sjdeptIds.length&&reportContent.length==0) {
	 * //如果新增数据，报告内容必填，涉及部门可以不填 return JsonBean.error("请填写报告内容/问题描述！"); }
	 * if(reportContent != null&&reportContent.length>0){ for (int i = 0; i <
	 * reportContent.length; i++) { if(reportContent[i]== null ||
	 * "".equals(reportContent[i])){ return JsonBean.error("报告内容/问题描述不完整，请填写！"); } }
	 * for (int i = 0; i < reportContent.length; i++) { if(reportContent[i]!= null
	 * && !"".equals(reportContent[i])){ // if(reportid.length>0 && reportid[i]!=
	 * null && !"".equals(reportid[i])){ tnsr = new TblNbsjSheetReportEntity();
	 * tnsr.setReportid(Integer.valueOf(reportid[i]));
	 * tnsr.setReportcontent(reportContent[i]); String sj=""; if(reportContent!=null
	 * && reportContent.length==1) { if(sjdeptIds!=null && sjdeptIds.length>0) { for
	 * (int j = 0; j < sjdeptIds.length; j++) { sj+=sjdeptIds[j]+","; }
	 * sj=sj.substring(0,sj.length()-1); } tnsr.setReportorgids(sj); }else {
	 * tnsr.setReportorgids(sjdeptIds[i].toString()); } tnsr.setTblNbsjSheet(sheet);
	 * tblNbsjSheetReportService.saveOrUpdate(tnsr); }else
	 * if(reportContent.length==1&&sjdeptIds.length>1){ tnsr = new
	 * TblNbsjSheetReportEntity(); tnsr.setReportcontent(reportContent[i]); String
	 * sj=""; for (int j = 0; j < sjdeptIds.length; j++) { if(j==0) {
	 * sj+=sjdeptIds[j]; }else { sj+=","+sjdeptIds[j]; } } tnsr.setReportorgids(sj);
	 * tnsr.setTblNbsjSheet(sheet); tblNbsjSheetReportService.save(tnsr); }else{
	 * tnsr = new TblNbsjSheetReportEntity();
	 * tnsr.setReportcontent(reportContent[i]); if(sjdeptIds.length>0
	 * &&sjdeptIds[i]!=null) { tnsr.setReportorgids(sjdeptIds[i]); }
	 * tnsr.setTblNbsjSheet(sheet); tblNbsjSheetReportService.save(tnsr); } } } } }
	 * catch (Exception e) { e.printStackTrace(); return JsonBean.error("报告保存失败！");
	 * } return JsonBean.success(tnsr.getReportid().toString()); }
	 * 
	 * @RequestMapping(value = "/sjss/pmp_audit_projecisCode", produces =
	 * "application/json; charset=utf-8") public
	 * 
	 * @ResponseBody String pmp_audit_projecisCode(TblNbsjSheetEntity blNbsjSheet,
	 * BigDecimal operateId, HttpServletRequest request) { TblNbsjProjectEntity
	 * project = this.tblnbsjProjectService.getSelectProject(); boolean exist =
	 * this.tBlNbsjSheetService.getSheetByCode(project.getProjectId(),
	 * blNbsjSheet.getSheetCode()); if (!exist) { return JsonBean.success(); } else
	 * { return JsonBean.error("编号已存在！"); } }
	 *//**
		 * 审计程序--完成
		 */
	/*
	 * @RequestMapping(value = "/sjss/finsh", produces =
	 * "application/json; charset=utf-8") public @ResponseBody String finsh(String
	 * id, HttpServletRequest request) { String
	 * targetId=request.getParameter("targetId"); Integer count =
	 * tBlNbsjSheetService.findByCount(targetId); if(count>0) { //有关联该任务的底稿，则已经生成底稿
	 * this.tblNbsjOperateService.finsh(id); return JsonBean.success(); }else {
	 * return JsonBean.error("未生成底稿"); } }
	 * 
	 *//**
		 * 底稿复合-导入数据
		 * 
		 * @param request
		 * @param sheet
		 * @return
		 */
	/*
	 * @RequestMapping(value = "/sjss/to_dggl_upload",produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * to_dggl_upload(HttpServletRequest request,TblNbsjSheetEntity sheet) { String
	 * attids = request.getParameter("attids"); try { sheet =
	 * tBlNbsjSheetService.getById(sheet.getSheetId()); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i]); sheet.getTblAttachments().add(att); } }
	 * 
	 * tBlNbsjSheetService.updateTblNbsjSheet(sheet); } catch (Exception e) {
	 * e.printStackTrace(); return JsonBean.error(); } return JsonBean.success(); }
	 * 
	 *//**
		 * @Des:底稿管理复核
		 */
	/*
	 * @RequestMapping(value = "/sjss/to_dggl_fh") public ModelAndView
	 * to_dggl_fh(HttpServletRequest request,BigDecimal sheetid) { //
	 * logger.info("底稿管理跳往复核页面"); ModelAndView mv = new ModelAndView();
	 * TblNbsjSheetEntity sheet = tBlNbsjSheetService.getById(sheetid);
	 * List<TblAttachmentEntity> fj =
	 * attachmentService.findAllByTblNBSJSheet(sheetid.toString());
	 * mv.addObject("fj",fj); mv.addObject("sheet",sheet); TblNbsjProjectEntity
	 * project = this.tblnbsjProjectService.getSelectProject();
	 * mv.addObject("project",project); mv.setViewName("nbsj/sjss/to_dggl_fh");
	 * //查询框代码 String choiceSearch = request.getParameter("choiceSearch");
	 * if(choiceSearch == null || "".equals(choiceSearch)) { choiceSearch = "hide";
	 * } mv.addObject("choiceSearch",choiceSearch); return mv; }
	 *//**
		 * @Des: 根据所选项目选择成员
		 */
	/*
	 * @RequestMapping(value = "/sj/check_project_user") public ModelAndView
	 * check_project_user(HttpServletRequest request,BigDecimal sheetid) { //
	 * logger.info("根据所选项目选择成员"); ModelAndView mv = new ModelAndView();
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * mv.addObject("num",request.getParameter("num"));
	 * mv.addObject("project",project);
	 * mv.setViewName("nbsj/sjss/check_project_user"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/dggl_fh") public @ResponseBody String
	 * dggl_fh(HttpServletRequest request,TblNbsjSheetFHEntity s, Find find) {
	 * String str = "o"; TblStaff user = (TblStaff)
	 * request.getSession().getAttribute("longUser"); TblNbsjSheetEntity sheet =
	 * tBlNbsjSheetService.getById(s.getSheet().getSheetId());
	 * tblNbsjSheetFHService.saveSheetFh(s.getFhOption(),s,sheet,user.getStaffid());
	 * tblNbsjSheetFHService.saveSheetFh(null,s,sheet,s.getStaffid());
	 * 
	 * //任务表 TblCirculation cir =
	 * tblCirculationService.saveTblCirculation(TblCirculation.TYPE_DGFH,
	 * sheet.getSheetCode(), sheet.getSheetName(), TblCirculation.URL_DGFH +
	 * sheet.getSheetId(), user.getStaffid()); AgentEntity ae = new AgentEntity();
	 * ae.setReviewer(s.getStaffid().toString()); if(s != null && s.getStaffid2() !=
	 * null){ ae.setReviewer_2(s.getStaffid2().toString());
	 * tblNbsjSheetFHService.saveSheetFh(null,s,sheet,s.getStaffid2()); } try {
	 * processService.start(ProcessEnum.SJ_DGFH.name(),user,cir); sheet =
	 * tBlNbsjSheetService.getById(s.getSheet().getSheetId());
	 * sheet.setState(TblNbsjSheetEntity.STATE2); String
	 * choosedUserName=request.getParameter("choosedUserName"); String
	 * choosedUserName2=request.getParameter("choosedUserName2");
	 * sheet.setApprover(s.getStaffid()!=null?choosedUserName+(s.getStaffid2()!=null
	 * ?","+choosedUserName2:""):""); //保存附件 String attids =
	 * request.getParameter("attids"); if (StringUtils.isNotBlank(attids)){ String[]
	 * ids = attids.split(","); for (int i = 0; i < ids.length; i++) {
	 * TblAttachmentEntity att = attachmentService.findById(ids[i].trim());
	 * sheet.getTblAttachments().add(att); } }
	 * tBlNbsjSheetService.updateTblNbsjSheet(sheet); }catch (Exception e){
	 * tblCirculationService.delTblCirculation(cir); str = "n"; e.printStackTrace();
	 * } return str; }
	 *//**
		 * @Des: 底稿管理--再次提交审批
		 */
	/*
	 * @RequestMapping(value = "/dggl/resubmit_dggl",produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * resubmit_dggl(HttpServletRequest request, TblNbsjSheetEntity s,
	 * 
	 * @RequestParam(value="reportConcent",required=false)String[]
	 * reportContent,@RequestParam(value="sjdeptIds",required=false)String[]
	 * sjDeptIds,
	 * 
	 * @RequestParam(value="reportid",required=false)String[] reportid) { String
	 * attids = request.getParameter("attids"); TblNbsjSheetEntity sheet = new
	 * TblNbsjSheetEntity(); try { sheet =
	 * tBlNbsjSheetService.getById(s.getSheetId());
	 * 
	 * sheet.setState(TblNbsjSheetEntity.STATE2);//状态
	 * sheet.setSheetCode(s.getSheetCode());// 底稿编号
	 * sheet.setSheetName(s.getSheetName());//底稿名称
	 * sheet.setBusinessAffiliation(s.getBusinessAffiliation());//
	 * sheet.setSheetTarget(s.getSheetTarget());
	 * 
	 * sheet.setAuditDesc(s.getAuditDesc());
	 * 
	 * sheet.setAuditDiscoverable(s.getAuditDiscoverable());
	 * sheet.setAuditCourse(s.getAuditCourse()); sheet.setUpdateTime(new Date());
	 * sheet.setRiskLevel(s.getRiskLevel());
	 * sheet.setSuditProcess(s.getSuditProcess());
	 * sheet.setTargetName(s.getTargetName()); sheet.setSjbwl(s.getSjbwl());
	 * sheet.setBusinessType(s.getBusinessType());
	 * sheet.setQuesTitle(s.getQuesTitle());
	 * 
	 * if (StringUtils.isNotBlank(attids)) { String[] ids = attids.split(","); for
	 * (int i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i]); sheet.getTblAttachments().add(att); } }
	 * if(null!=sjDeptIds&&reportContent.length==0) { return
	 * JsonBean.error("请填写报告内容/问题描述！"); } if(reportContent !=
	 * null&&reportContent.length>0){ TblNbsjSheetReportEntity tnsr = null; for (int
	 * i = 0; i < reportContent.length; i++) { if(reportContent[i]== null ||
	 * "".equals(reportContent[i])){ return JsonBean.error("报告内容/问题描述不完整，请填写！"); } }
	 * for (int i = 0; i < reportContent.length; i++) { //内容不为空
	 * if(reportContent[i]!= null && !"".equals(reportContent[i])){ //
	 * if(reportid.length>0 && reportid[i]!= null && !"".equals(reportid[i])){ tnsr
	 * = new TblNbsjSheetReportEntity();
	 * tnsr.setReportid(Integer.valueOf(reportid[i]));
	 * tnsr.setReportcontent(reportContent[i]); String sj=""; if(reportContent!=null
	 * && reportContent.length==1) { if(sjDeptIds!=null && sjDeptIds.length>0) { for
	 * (int j = 0; j < sjDeptIds.length; j++) { sj+=sjDeptIds[j]+",";
	 * 
	 * if(j==0) { sj+=sjdeptIds[j]; }else { sj+=","+sjdeptIds[j]; }
	 * 
	 * } tnsr.setReportorgids(sj.substring(0,sj.length()-1)); }else {
	 * tnsr.setReportorgids(sj); } }else {
	 * tnsr.setReportorgids(sjDeptIds[i].toString()); } tnsr.setTblNbsjSheet(sheet);
	 * tblNbsjSheetReportService.saveOrUpdate(tnsr); }else
	 * if(reportContent.length==1&&sjDeptIds.length>1){ tnsr = new
	 * TblNbsjSheetReportEntity(); tnsr.setReportcontent(reportContent[i]); String
	 * sj=""; for (int j = 0; j < sjDeptIds.length; j++) { if(j==0) {
	 * sj+=sjDeptIds[j]; }else { sj+=","+sjDeptIds[j]; } } tnsr.setReportorgids(sj);
	 * tnsr.setTblNbsjSheet(sheet); tblNbsjSheetReportService.save(tnsr); }else{
	 * tnsr = new TblNbsjSheetReportEntity();
	 * tnsr.setReportcontent(reportContent[i]); if(sjDeptIds.length>0
	 * &&sjDeptIds[i]!=null) { tnsr.setReportorgids(sjDeptIds[i]); }
	 * tnsr.setTblNbsjSheet(sheet); tblNbsjSheetReportService.save(tnsr); } } } } //
	 * 审计发现
	 * 
	 * tBlNbsjSheetService.merge(sheet); List<TblNbsjQuestionEntity> quesList =
	 * s.getQuestions(); if(quesList != null && quesList.size() >0){ String quesIds
	 * = null; for (TblNbsjQuestion ques : quesList) { quesIds +=
	 * ques.getQuestionId()+","; } quesIds = quesIds.substring(0,
	 * quesIds.length()-1);
	 * this.tblNbsjQuestionService.updateSheetidsByids(quesIds,sheet.getSheetId());
	 * } String cyId = request.getParameter("cyId"); TblCirculation c =
	 * tblCirculationService.get(cyId); c.setCycode(sheet.getSheetCode());//
	 * 设置我的传阅类中的编号 c.setCyname(sheet.getSheetName());
	 * c.setCystate(TblCirculation.STATE_FQ); tblCirculationService.update(c); }
	 * catch (Exception e) { e.printStackTrace(); return JsonBean.error(); } return
	 * JsonBean.success(); }
	 * 
	 * @RequestMapping(value = "/dggl/modify_resubmit_dggl",produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * modify_resubmit_dggl(HttpServletRequest request,TblNbsjSheetEntity s) {
	 * String attids = request.getParameter("attids"); TblNbsjSheetEntity sheet =
	 * new TblNbsjSheetEntity(); try { sheet =
	 * tBlNbsjSheetService.getById(s.getSheetId());
	 * sheet.setSheetCode(s.getSheetCode());//底稿编号
	 * sheet.setSheetName(s.getSheetName());
	 * sheet.setBusinessAffiliation(s.getBusinessAffiliation());
	 * sheet.setSheetTarget(s.getSheetTarget());
	 * sheet.setAuditDesc(s.getAuditDesc());
	 * sheet.setAuditDiscoverable(s.getAuditDiscoverable());
	 * sheet.setAuditCourse(s.getAuditCourse()); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i]); sheet.getTblAttachments().add(att); } }
	 * tBlNbsjSheetService.updateTblNbsjSheet(sheet); } catch (Exception e) {
	 * e.printStackTrace(); return JsonBean.error(); } return JsonBean.success(); }
	 * 
	 *//**
		 * 引用底稿列表
		 */
	/*
	 * @RequestMapping(value = "/sheet/fxquesSheet") public ModelAndView
	 * fxquesSheet(HttpServletRequest request){ Integer pageNumber = 1; String
	 * number = request.getParameter("pageNumber"); if (number != null &&
	 * number.length() > 0) { pageNumber = Integer.parseInt(number); }
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * ModelAndView mv = new ModelAndView(); PageBean sheetPageBean =
	 * tBlNbsjSheetService.findDgByProjectIdAndStatus(project.getProjectId(),
	 * pageNumber,pageBean.getPageSize());
	 * mv.setViewName("nbsj/sjzj/sheet_qust_find"); mv.addObject("pageBean",
	 * sheetPageBean); return mv; }
	 *//**
		 * 工作底稿
		 */
	/*
	 * @RequestMapping(value = "/sjss/project_standard_listdgall") public
	 * ModelAndView project_standard_listdgall( HttpServletRequest request) {
	 * Integer pageNumber = 1; String number1 = request.getParameter("pageNumber");
	 * if (number1 != null && number1.length() > 0) { pageNumber =
	 * Integer.parseInt(number1); } TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); ModelAndView mv = new
	 * ModelAndView(); try { if (project != null) { TblStaff tblStaff = (TblStaff)
	 * request.getSession().getAttribute("longUser"); String number =
	 * request.getParameter("num"); String name = request.getParameter("name");
	 * String state = request.getParameter("state"); String risklevel =
	 * request.getParameter("risklevel"); String pmid =
	 * request.getParameter("pmid"); TblNbsjSheetEntity sheet = new
	 * TblNbsjSheetEntity(); if (number != null && number != "") {
	 * sheet.setSheetCode(number); } if (name != null && name != "") {
	 * sheet.setSheetName(name); } if (state != null && state != "") {
	 * sheet.setState(Integer.parseInt(state)); } if (pmid != null && pmid != "") {
	 * TblStaff staff = userService.findById(pmid); sheet.setCreateStaff(staff); }
	 * sheet.setRiskLevel(risklevel); //当前公司 TblOrganization organization =
	 * (TblOrganization) request.getSession().getAttribute("hbOrgEntity"); //
	 * 负责人可以看到当前审计项目的所有底稿 pageBean =
	 * this.tBlNbsjSheetService.findAllSheetByOrgid(organization.getOrgid(),
	 * pageNumber, pageBean.getPageSize(), sheet); mv.addObject("pageBean",
	 * pageBean); mv.addObject("project", project); mv.addObject("number", number);
	 * mv.addObject("name", name);
	 * mv.setViewName("nbsj/sjss/project_standard_listdgall"); } } catch
	 * (NumberFormatException e) { e.printStackTrace(); } catch (Exception e) {
	 * e.printStackTrace(); } return mv; }
	 * 
	 *//**
		 * 审计发现
		 */
	/*
	 * @RequestMapping(value = "/xmzl/question_store_list") public ModelAndView
	 * question_store_list(Integer pageNumber, String view, HttpServletRequest
	 * request) { // logger.info("内部审计---审计实施---审计发现---列表页查询"); ModelAndView mv =
	 * new ModelAndView(); String status = request.getParameter("status"); String
	 * pmids = request.getParameter("pmids"); String businessAffiliation =
	 * request.getParameter("businessAffiliation"); String riskAttrbution =
	 * request.getParameter("riskAttrbution"); String recstatus=
	 * request.getParameter("recstatus"); TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); String projectId =
	 * request.getParameter("projectId"); if (projectId !=
	 * null&&projectId.length()>0) { project =
	 * tblnbsjProjectService.getById(projectId.toString()); }
	 * 
	 * if (project != null) {
	 * if(project.getTblPm().getStaffid().toString().equals(tblStaff.getStaffid().
	 * toString())){ pageBean =
	 * this.tblNbsjQuestionService.findQuestion(recstatus,status, pmids,
	 * businessAffiliation, riskAttrbution, project.getProjectid(), pageNumber,
	 * pageBean.getPageSize()); }else{ pageBean =
	 * this.tblNbsjQuestionService.findQuestion(recstatus,status, pmids,
	 * businessAffiliation, riskAttrbution, project.getProjectid(), pageNumber,
	 * pageBean.getPageSize()); } pageBean =
	 * this.tblNbsjQuestionService.findQuestion(recstatus,status, pmids,
	 * businessAffiliation, riskAttrbution, project.getProjectId(), pageNumber,
	 * pageBean.getPageSize()); mv.addObject("pageBean", pageBean); if (pmids !=
	 * null && pmids.trim().length() > 0) { TblStaff user =
	 * userService.findById(pmids); mv.addObject("user", user); }
	 * mv.addObject("project", project); mv.addObject("status", status);
	 * mv.addObject("businessAffiliation", businessAffiliation);
	 * mv.addObject("riskAttrbution", riskAttrbution);
	 * mv.setViewName("nbsj/wdcx/question_store_list"); mv.addObject("view", view);
	 * mv.addObject("fication", request.getParameter("fication"));//项目归档返回
	 * mv.addObject("projectId", projectId); mv.addObject("recstatus", recstatus); }
	 * else { setErrorJsp("001",request); mv.setViewName("nbsj/main41"); } //查询框代码
	 * String choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch
	 * == null || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 * @RequestMapping(value = "/xmzl/sjfx_export") public
	 * 
	 * @ResponseBody String sjfx_export(HttpServletRequest request,
	 * HttpServletResponse response) { //
	 * logger.info("内部审计---审计实施---审计发现---导出Excel"); String questions =
	 * request.getParameter("coolieids"); questions = questions.replace("//|",
	 * ",").substring(0, questions.length() - 1);
	 * response.setContentType("application/binary;charset=UTF-8"); try {
	 * response.setHeader("Content-Disposition", "attachment;filename=" + new
	 * String("审计发现".getBytes(),"iso-8859-1") + ".xlsx"); ServletOutputStream
	 * outputStream = response.getOutputStream(); List<Object[]> objList =
	 * tblNbsjQuestionService.findQuestionObjects(questions); String[] titles =
	 * {"业务归属 ", "被审计单位", "审计发现 ", "关联工作底稿编号", "风险归属", "发现人", "是否分组汇总", "是否事实确认"};
	 * ImportOrExportExcelUtil.exportExcel(titles, objList, outputStream, null); }
	 * catch (Exception e) { // logger.info("内部审计---审计实施---审计发现---导出Excel失败"); }
	 * return null; }
	 * 
	 * @RequestMapping(value = "/xmzl/audit_question_disp") public ModelAndView
	 * audit_question_disp() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/wdcx/audit_question_disp"); return mv; }
	 * 
	 *//**
		 * 审计发现---发起整改
		 *
		 * @param request
		 * @return
		 */
	/*
	 * @RequestMapping(value = "/sjzg/zgfp_fqStatus", produces =
	 * "application/json; charset=utf-8") public
	 * 
	 * @ResponseBody String zgfp_fqStatus(HttpServletRequest request) { String
	 * questionid = request.getParameter("questionid"); //
	 * logger.info(" 审计发现---发起整改"); if (questionid != null && questionid.length() >
	 * 0) { TblNbsjQuestionEntity question = tblNbsjQuestionService.getById(new
	 * BigDecimal(questionid)); if (question != null) { TblNbsjRefopmEntity
	 * nbsjRefopm = tblNbsjRefopmService.getByQuestid(questionid); if (nbsjRefopm ==
	 * null || nbsjRefopm.getStatus() != 2) { if (question.getStatus() == 2) {
	 * question.setRecStatus(TblNbsjQuestionEntity.FQYES);
	 * tblNbsjQuestionService.saveOrUpdate(question); return JsonBean.success(); }
	 * else { return JsonBean.error("该审计发现未进行事实确认"); } } else { return
	 * JsonBean.error("该审计发现已整改完毕"); } } else { return JsonBean.error("发起整改失败"); } }
	 * else { return JsonBean.error("请选择要整改的问题"); } }
	 *//**
		 * 整改跟踪指派人员
		 *
		 * @param request
		 * @return
		 */
	/*
	 * @RequestMapping(value = "/sjzg/assign") public ModelAndView
	 * zggzAssign(HttpServletRequest request) { String userName =
	 * request.getParameter("userId"); String sId =
	 * request.getParameter("selectedId"); TblNbsjRefopmEntity reform = new
	 * TblNbsjRefopmEntity(); if (sId != null && sId.trim().length() > 0) { boolean
	 * is = false; TblNbsjQuestionEntity question =
	 * tblNbsjQuestionService.getById(new BigDecimal(sId)); reform =
	 * tblNbsjRefopmService.getByQuestid(question.getQuestionId().toString()); if
	 * (reform == null) { reform = new TblNbsjRefopmEntity(); is = true; } if
	 * (userName != null && userName.trim().length() > 0) { TblStaff user =
	 * userService.findById(userName); reform.setNbsuser(user); }
	 * reform.setNbsjQuestion(question);
	 * reform.setStatus(TblNbsjRefopmEntity.STATUSNO); if (is) { TblStaff attribute
	 * = (TblStaff) request.getSession().getAttribute("longUser");
	 * reform.setTblCeaters(attribute); tblNbsjRefopmService.save(reform); } else {
	 * TblStaff attribute = (TblStaff)
	 * request.getSession().getAttribute("longUser");
	 * reform.setTblCeaters(attribute); tblNbsjRefopmService.update(reform); } }
	 * return question_allocate_listZggz(null,null,null, request); }
	 * 
	 *//**
		 * 添加审计发现
		 */
	/*
	 * @RequestMapping(value = "/sjss/question_add") public ModelAndView
	 * question_add(String sheetId, String operateId) { ModelAndView mv = new
	 * ModelAndView(); TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject(); mv.addObject("project",
	 * project); mv.addObject("sheetId", sheetId); mv.addObject("operateId",
	 * operateId); mv.setViewName("nbsj/sjss/question_add"); return mv; }
	 *//**
		 * 保存审计发现
		 */
	/*
	 * @RequestMapping(value = "/sjss/question_save", produces =
	 * "application/json; charset=utf-8") public
	 * 
	 * @ResponseBody String question_save(BigDecimal sheetId, TblNbsjQuestionEntity
	 * nbsjQuestion, String findTimes, String occurrenceTimes, HttpServletRequest
	 * request) { TblNbsjSheetEntity nbsjSheet =
	 * this.tBlNbsjSheetService.getById(sheetId); if (null != nbsjSheet) { //
	 * TblStaff tblStaff = (TblStaff) //
	 * request.getSession().getAttribute("longUser"); //
	 * nbsjQuestion.setCreateTime(new Date()); //
	 * nbsjQuestion.setFindStaff(tblStaff); // nbsjQuestion.setNbsjSheet(nbsjSheet);
	 * // nbsjQuestion.setFindTime(DateUtils.parse(findTimes, //
	 * DateUtils.DATE_SMALL_STR)); //
	 * nbsjQuestion.setOccurrenceTime(DateUtils.parse(occurrenceTimes, //
	 * DateUtils.DATE_SMALL_STR)); this.tblNbsjQuestionService.save(nbsjQuestion);
	 * return JsonBean.success(); } return JsonBean.error(); }
	 * 
	 *//**
		 * 删除审计发现
		 */
	/*
	 * @RequestMapping(value = "/sjss/question_delete", produces =
	 * "application/json; charset=utf-8") public
	 * 
	 * @ResponseBody String question_delete(String id, HttpServletRequest request) {
	 * this.tblNbsjQuestionService.delete(id); return JsonBean.success(); }
	 * 
	 * @RequestMapping(value = "/sjzb/menu_left_tree_check_list_my") public
	 * ModelAndView zbmenu_left_tree_check_list_my() { ModelAndView mv = new
	 * ModelAndView(); mv.setViewName("nbsj/sjzb/menu_left_tree_check_list_my");
	 * return mv; }
	 * 
	 * @RequestMapping(value = "/xmzl/standard_manuscript_dec") public ModelAndView
	 * standard_manuscript_dec() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjss/standard_manuscript_dec"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjzb/check_list_my") public ModelAndView
	 * zbcheck_list_all_my() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjzb/check_list_my"); return mv; }
	 * 
	 *//**
		 * 中荷审计发现
		 */
	/*
	 * @RequestMapping(value = "/sheet/sjfx_ques_list") public ModelAndView
	 * sjfx_ques_list(Integer pageNumber, HttpServletRequest request){
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * if(null!=project &&project.getStatus()==18) { List<TblZhQuestionEntity> list
	 * =
	 * tblZhQuestionService.findCountByProjectId(project.getProjectId().toString());
	 * if(null==list||list.size()==0) {
	 * this.insalizaQues(project.getProjectId().toString(),request); } } TblStaff
	 * tblStaff = (TblStaff) request.getSession().getAttribute("longUser");
	 * ModelAndView mv = new ModelAndView(); if (project != null) {
	 * //项目下的审计风险问题,暂时不区分创建人
	 * pageBean=tblZhQuestionService.findAll(project.getProjectId(),pageNumber,
	 * pageBean.getPageSize()); mv.addObject("pageBean", pageBean);
	 * mv.setViewName("nbsj/sjzj/sjfx_qust_list"); } else {
	 * setErrorJsp("001",request); mv.setViewName("nbsj/main41"); } return mv; }
	 *//**
		 * 中荷审计发现---新增
		 */
	/*
	 * @RequestMapping(value = "/sheet/sjfx_qust_add") public ModelAndView
	 * sjfx_ques_add(HttpServletRequest request) { ModelAndView mv = new
	 * ModelAndView(); TblNbsjProjectEntity tblpro =
	 * this.tblnbsjProjectService.getSelectProject();
	 * 
	 * TblStaff tblStaff = (TblStaff) request.getSession().getAttribute("longUser");
	 * //终稿报告 List<TblReportEntity> findReportByProjectId =
	 * tblReportService.findReportByProjectId(tblpro.getProjectId(),"终稿",null);
	 * if(findReportByProjectId.size()!=0) { TblReportEntity tblReport =
	 * findReportByProjectId.get(0); mv.addObject("tblReport", tblReport); }
	 * mv.addObject("tblpro", tblpro); mv.setViewName("nbsj/sjzj/sjfx_qust_add");
	 * return mv; }
	 *//**
		 * 中荷审计发现---查看页面
		 */
	/*
	 * @RequestMapping(value = "/sheet/sjfx_qust_view") public ModelAndView
	 * sjfx_ques_view(HttpServletRequest request,String qustid) { ModelAndView mv =
	 * new ModelAndView(); TblZhQuestionEntity findByid =
	 * tblZhQuestionService.findByid(qustid); mv.addObject("tblZhQuestion",
	 * findByid); mv.setViewName("nbsj/sjzj/sjfx_qust_view"); return mv; }
	 *//**
		 * 中荷审计发现---验证是否发出终稿报告
		 */
	/*
	 * @RequestMapping(value = "/sheet/is_sjfx_ques")
	 * 
	 * @ResponseBody public String is_sjfx_ques(HttpServletRequest request) {
	 * TblNbsjProjectEntity tblpro = this.tblnbsjProjectService.getSelectProject();
	 * //终稿报告
	 * 
	 * if(tblpro!=null&&tblpro.getStatus()!=18) { return "1"; }
	 * 
	 * return "0";//终稿已发出 }
	 *//**
		 * 中荷审计发现---删除
		 */
	/*
	 * @RequestMapping(value = "/sheet/sjfx_qust_delete")
	 * 
	 * @ResponseBody public String sjfx_qust_delete(HttpServletRequest
	 * request,String qustid) { try { TblZhQuestionEntity findByid =
	 * tblZhQuestionService.findByid(qustid); tblZhQuestionService.del(findByid);
	 * return "0";//删除成功 }catch (Exception e) { return "1";//失败 } }
	 *//**
		 * 中荷审计发现---跳转修改页面
		 */
	/*
	 * @RequestMapping(value = "/sheet/sjfx_qust_modi") public ModelAndView
	 * sjfx_qust_modi(HttpServletRequest request,String qustid) { ModelAndView mv =
	 * new ModelAndView(); TblZhQuestionEntity list =
	 * tblZhQuestionService.findByQuesid(qustid);
	 * mv.setViewName("nbsj/sjzj/sjfx_qust_modi");
	 * mv.addObject("tblZhQuestion",list); return mv; }
	 *//**
		 * 中荷审计发现
		 */
	/*
	 * @RequestMapping(value = "/sheet/sjfx_ques_save")
	 * 
	 * public @ResponseBody String sjfx_ques_save(HttpServletRequest
	 * request,TblZhQuestionEntity tblZhQuestion) throws ParseException { TblStaff
	 * tblStaff = (TblStaff) request.getSession().getAttribute("longUser"); //id为空
	 * //项目 TblNbsjProjectEntity project =
	 * this.tblnbsjProjectService.getSelectProject();
	 * tblZhQuestion.setTblpro(project); //终稿报告 List<TblReportEntity>
	 * findReportByProjectId =
	 * tblReportService.findReportByProjectId(project.getProjectId(),"终稿",null);
	 * if(findReportByProjectId.size()==0) { return "1"; }else { TblReportEntity
	 * tblReport = findReportByProjectId.get(0);
	 * tblZhQuestion.setTblreport(tblReport); } //关联底稿编号 String sheetCode =
	 * request.getParameter("sheetCode"); if(StringUtils.isNotEmpty(sheetCode)) {
	 * tblZhQuestion.setSheetCode(sheetCode); } //总公司、组织 String oid =
	 * request.getParameter("oid"); if(null!=oid) { TblOrganization organ =
	 * organizationService.findById(oid); tblZhQuestion.setOrgan(organ); } //分公司
	 * String oid2 = request.getParameter("oid2"); if(null!=oid2) { TblOrganization
	 * branch = organizationService.findById(oid2); tblZhQuestion.setBranch(branch);
	 * } if(null==tblZhQuestion.getQustid()) { //创建人 }
	 * tblZhQuestion.setCreateUser(tblStaff); String createtime =
	 * request.getParameter("questime"); if(null!=createtime) { SimpleDateFormat sdf
	 * = new SimpleDateFormat("yyyy-MM-dd");
	 * tblZhQuestion.setCreateDate(sdf.parse(createtime)); } //提交ORM跟踪时间
	 * tblZhQuestionService.save(tblZhQuestion); //返回id return
	 * tblZhQuestion.getQustid().toString(); }
	 *//**
		 * 初始化审计问题
		 * 
		 * @param request
		 * @param tblZhQuestion
		 */
	/*
	 * private void insalizaQues(String id,HttpServletRequest request) { TblStaff
	 * tblStaff = (TblStaff) request.getSession().getAttribute("longUser");
	 * TblOrganization attribute = (TblOrganization)
	 * request.getSession().getAttribute("hbOrgEntity"); //项目 TblNbsjProjectEntity
	 * project = this.tblnbsjProjectService.getById(id); //终稿报告id
	 * List<TblReportEntity> findReportByProjectId =
	 * tblReportService.findReportByProjectId(project.getProjectId(),"终稿",3);
	 * //报告邮件发出 if(findReportByProjectId!=null&&project.getStatus()==18) {
	 * TblReportEntity tblReport = findReportByProjectId.get(0);
	 * List<TblNbsjSheetEntity> list =
	 * tBlNbsjSheetService.findDgByQues(project.getProjectId()); for
	 * (TblNbsjSheetEntity tBlNbsjSheet : list) { TblZhQuestionEntity tblZhQuestion
	 * =new TblZhQuestionEntity(); tblZhQuestion.setTblreport(tblReport);
	 * tblZhQuestion.setTblpro(project); //底稿编号、问题标题 String sheetid =
	 * tBlNbsjSheet.getSheetId().toString(); if(StringUtils.isNotEmpty(sheetid)) {
	 * TblNbsjSheetEntity nbsjsheet = tBlNbsjSheetService.getById(new
	 * BigDecimal(sheetid)); tblZhQuestion.setSheetCode(nbsjsheet.getSheetCode());
	 * tblZhQuestion.setQuesTitle(nbsjsheet.getQuesTitle()); } String flowNextId =
	 * null; try { flowNextId =
	 * tblAutonoNumberService.findRootNumberByParentId("QUESCODE","TBL_ZH_QUESTION",
	 * "PROJECTID","PROJECTID","TBL_NBSJ_PROJECT","ORGID",attribute.getOrgid(),325,
	 * null, null,null,null,new BigDecimal(id)); } catch (Exception e) {
	 * e.printStackTrace(); } tblZhQuestion.setQuescode(flowNextId); //关联底稿 //创建人
	 * tblZhQuestion.setCreateUser(tblStaff); //tblZhQuestion.setCreateDate(new
	 * Date()); tblZhQuestionService.save(tblZhQuestion); } } //返回id }
	 *//**
		 * 发现问题列表
		 */
	/*
	 * @RequestMapping(value = "/sheet/fxquesTitle") public ModelAndView
	 * fxquesTitle(HttpServletRequest request){ Integer pageNumber = 1; String
	 * number = request.getParameter("pageNumber"); if (number != null &&
	 * number.length() > 0) { pageNumber = Integer.parseInt(number); }
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * ModelAndView mv = new ModelAndView(); PageBean sheetPageBean =
	 * tBlNbsjSheetService.findDgByProjectIdAndStatus(project.getProjectId(),
	 * pageNumber,pageBean.getPageSize());
	 * mv.setViewName("nbsj/sjzj/sheet_qust_list"); mv.addObject("pageBean",
	 * sheetPageBean); return mv; }
	 * 
	 * @RequestMapping(value = "/sjgk/sjgkquestionList") public ModelAndView
	 * sjgkquestionList(Integer pageNumber, String view, HttpServletRequest request)
	 * { // logger.info("内部审计---审计实施---审计发现---列表页查询"); ModelAndView mv = new
	 * ModelAndView(); String status = request.getParameter("status"); String pmids
	 * = request.getParameter("pmids"); String businessAffiliation =
	 * request.getParameter("businessAffiliation"); String riskAttrbution =
	 * request.getParameter("riskAttrbution"); String recstatus=
	 * request.getParameter("recstatus"); // String projectName =
	 * request.getParameter("projectNames"); String projectCode =
	 * request.getParameter("projectCode"); String projectSource =
	 * request.getParameter("projectSources"); String bsjdw =
	 * request.getParameter("bsjdw");//被审计单位，人或组织 TblNbsjProjectEntity project = new
	 * TblNbsjProjectEntity(); project.setPProjectName(projectName);
	 * project.setProjectSource(projectSource); project.setProjectCode(projectCode);
	 * project.setAuditType(bsjdw);//代存
	 * 
	 * TblOrganization organization = (TblOrganization)
	 * request.getSession().getAttribute("hbOrgEntity"); pageBean =
	 * this.tblNbsjQuestionService.findQuestionByJt(recstatus,status, pmids,
	 * businessAffiliation,
	 * riskAttrbution,organization.getOrgid().toString(),project, pageNumber,
	 * pageBean.getPageSize()); mv.addObject("pageBean", pageBean); if (pmids !=
	 * null && pmids.trim().length() > 0) { TblStaff user =
	 * userService.findById(pmids); mv.addObject("user", user); }
	 * mv.addObject("status", status); mv.addObject("pro", project);
	 * mv.addObject("businessAffiliation", businessAffiliation);
	 * mv.setViewName("nbsj/sjgk/question_store_list"); mv.addObject("view", view);
	 * mv.addObject("fication", request.getParameter("fication"));//项目归档返回
	 * mv.addObject("recstatus", recstatus); //查询框代码 String choiceSearch =
	 * request.getParameter("choiceSearch"); if(choiceSearch == null ||
	 * "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 *//**
		 * 事实确认书--列表
		 */
	/*
	 * @RequestMapping(value = "/sjss/confirmation_list") public ModelAndView
	 * confirmation_list(HttpServletRequest request, Find find) { //
	 * logger.info("内部审计--审计事实--事实确认书列表页"); ModelAndView mv = new ModelAndView();
	 * String pageNumber = request.getParameter("pageNumber"); TblStaff user =
	 * (TblStaff) request.getSession().getAttribute("longUser");
	 * TblNbsjProjectEntity project = this.tblnbsjProjectService.getSelectProject();
	 * String projectId = request.getParameter("projectId"); String str=""; if
	 * (projectId != null&&projectId.length()>0) { project =
	 * tblnbsjProjectService.getById(projectId.toString()); str="1"; } if (null !=
	 * project) { if(str!=null && str.equals("1")) { pageBean =
	 * tblNbsjFactbookService.findAll(find, project.getProjectId(), pageNumber ==
	 * null ? 1 : Integer.parseInt(pageNumber), pageBean.getPageSize()); }else {
	 * pageBean = tblNbsjFactbookService.findAll(find, project.getProjectId(),
	 * user.getStaffid().toString(), pageNumber == null ? 1 :
	 * Integer.parseInt(pageNumber), pageBean.getPageSize()); }
	 * 
	 * } else { setErrorJsp("001",request); } String identifier = ""; try {
	 * identifier = activityPluginsService.getoNState(ProcessEnum.SJ_SSQRS.name());
	 * } catch (Exception e) { e.printStackTrace(); }
	 * mv.addObject("identifier",identifier); mv.addObject("projectId",projectId);
	 * mv.setViewName("nbsj/sjss/confirmation_list"); mv.addObject("fication",
	 * request.getParameter("fication"));//项目归档返回 mv.addObject("pageBean",
	 * pageBean); mv.addObject("find", find); mv.addObject("view",
	 * request.getParameter("view")); //查询框代码 String choiceSearch =
	 * request.getParameter("choiceSearch"); if(choiceSearch == null ||
	 * "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/confirmation_qrr_list") public ModelAndView
	 * confirmation_qrr_list(HttpServletRequest request) { //
	 * logger.info("内部审计--审计事实--事实确认书列表页-按确认人并且传阅的"); ModelAndView mv = new
	 * ModelAndView(); String pageNumber = request.getParameter("pageNumber");
	 * TblStaff user = (TblStaff) request.getSession().getAttribute("longUser");
	 * pageBean =
	 * tblNbsjFactbookService.findAllByQRRCY(user.getStaffid().toString(),
	 * pageNumber == null ? 1 : Integer.parseInt(pageNumber),
	 * pageBean.getPageSize()); mv.setViewName("nbsj/sjss/confirmation_qrr_list");
	 * mv.addObject("pageBean", pageBean); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/confirmation_cy") public ModelAndView
	 * confirmation_cy(HttpServletRequest request, String factid) { //
	 * logger.info("内部审计--审计事实--设置传阅"); TblNbsjFactbookEntity factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid);
	 * factbook.setStatus(factbook.STATUS_2);
	 * tblNbsjFactbookService.updateNbsjFactBook(factbook); return
	 * confirmation_list(request, new Find(factid)); }
	 *//**
		 * 事实确认书----新增
		 */
	/*
	 * @RequestMapping(value = "/sjss/confirmation_add") public ModelAndView
	 * confirmation_add(HttpServletRequest request, String factid) { //
	 * logger.info("内部审计--审计事实--跳转事实确认书添加或修改页面"); ModelAndView mv = new
	 * ModelAndView(); TblNbsjProjectEntity selectProject = new
	 * TblNbsjProjectEntity(); TblNbsjFactbookEntity factbook = null;
	 * List<TblAttachmentEntity> factAtt = null; //pageBean.setRecordList(new
	 * ArrayList<>()); List<TblNbsjQuestionEntity> findQuestionList=null; if
	 * (StringUtils.isNotBlank(factid)) { factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid); String pageNumber =
	 * request.getParameter("pageNumber"); if (factbook != null &&
	 * factbook.getTblNbsjProject() != null &&
	 * factbook.getTblNbsjProject().getProjectId() != null) { selectProject =
	 * tblnbsjProjectService.getById(factbook.getTblNbsjProject().getProjectId().
	 * toString()); Set<TblNbsjProjectTeamEntity> teams =
	 * selectProject.getTblProjectTeams(); for (TblNbsjProjectTeamEntity
	 * tblnbsjProjectTeam : teams) { List<TblNbsjTeamstaffEntity> teamStaffs =
	 * tblnbsjProjectTeam.getTeamStaffs(); for (TblNbsjTeamstaffEntity
	 * tblNbsjTeamStaff : teamStaffs) { if
	 * (tblNbsjTeamStaff.getStafftype().equals(TblNbsjTeamstaffEntity.LEADER)) {
	 * TblStaff pro_staff = tblNbsjTeamStaff.getStaff();
	 * mv.addObject("pro_staff",pro_staff); } } } findQuestionList =
	 * tblNbsjQuestionService.findQuestion(factid); //pageBean =
	 * tBlNbsjSheetService.findNbsjSheetByFactBookId(factid,
	 * factbook.getTblNbsjProject().getProjectid().toString(), pageNumber == null ?
	 * 1 : Integer.parseInt(pageNumber), 10); } factAtt =
	 * attachmentService.findAttachmentByNbsjFactBook(factid); } else {
	 * selectProject = tblnbsjProjectService.getSelectProject(); } String view =
	 * request.getParameter("view"); if (StringUtils.isNotBlank(view) &&
	 * view.trim().equals("qrs")) { mv.setViewName("nbsj/sjss/confirmation_qr_add");
	 * } else { mv.setViewName("nbsj/sjss/confirmation_add"); }
	 * mv.addObject("sp",request.getParameter("btn")); mv.addObject("view", view);
	 * mv.addObject("factbook", factbook); mv.addObject("factAtt", factAtt);
	 * mv.addObject("pageBean", pageBean); mv.addObject("findQuestionList",
	 * findQuestionList); mv.addObject("selectProject", selectProject); //查询框代码
	 * String choiceSearch = request.getParameter("choiceSearch"); if(choiceSearch
	 * == null || "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 *//**
		 * @Des: 审计 事实确认书--审批
		 */
	/*
	 * @RequestMapping(value = "/sjss/to_sp_ssqrs") public ModelAndView
	 * to_sp_ssqrs(HttpServletRequest request,BigDecimal spid) { ModelAndView mv =
	 * new ModelAndView(); TblNbsjFactbookEntity factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(spid.toString());
	 * TblNbsjProjectEntity selectProject =
	 * tblnbsjProjectService.getById(factbook.getTblNbsjProject().getProjectId().
	 * toString()); String tId = request.getParameter("tId");
	 * if(StringUtils.isNotBlank(tId) &&
	 * factbook.getStatus().intValue()!=TblNbsjFactbookEntity.STATUS_3){
	 * List<String> btnList = null; try { btnList =
	 * processService.getButtonsForTransition(tId); } catch (Exception e) {
	 * e.printStackTrace(); } mv.addObject("btnList",btnList); } String cyId =
	 * request.getParameter("cyId"); if (StringUtils.isNotBlank(cyId)){
	 * TblCirculation cy = tblCirculationService.get(cyId); mv.addObject("cy",cy); }
	 * String pageNumber = request.getParameter("pageNum"); pageBean =
	 * tBlNbsjSheetService.findNbsjSheetByFactBookId(spid.toString(),
	 * factbook.getTblNbsjProject().getProjectId().toString(), pageNumber == null ?
	 * 1 : Integer.parseInt(pageNumber), 15); List<TblAuditOption> ao =
	 * tblAuditOptionService.findOptionByRelation(spid.toString(),Integer.parseInt(
	 * cyId)); mv.addObject("selectProject",selectProject);
	 * mv.addObject("factbook",factbook); mv.addObject("ao",ao);
	 * mv.addObject("tId",tId); mv.addObject("v",request.getParameter("v"));
	 * List<TblAttachmentEntity> fj =
	 * attachmentService.findAttachmentByNbsjFactBook(spid.toString());
	 * mv.addObject("fj", fj); mv.addObject("pageBean", pageBean);
	 * mv.setViewName("nbsj/sjss/to_sp_ssqrs"); return mv; }
	 *//**
		 * @Des: 事实确认书 再次提交
		 */
	/*
	 * @RequestMapping(value = "/sjss/resubmit_ssqrs",produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * resubmit_ssqrs(HttpServletRequest request,TblNbsjFactbookEntity book) {
	 * String attids = request.getParameter("attids"); TblNbsjFactbookEntity fack =
	 * new TblNbsjFactbookEntity(); try { fack =
	 * tblNbsjFactbookService.geTblNbsjFactbook(book.getFactid().toString());
	 * fack.setDescribe(book.getDescribe());
	 * fack.setStatus(TblNbsjFactbookEntity.STATUS_2); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i]); fack.getTblNbsjFactbookatts().add(att); }
	 * } if(fack!=null){ List<TblNbsjQuestionEntity>
	 * list=tblNbsjQuestionService.findQuestion(fack.getFactid().toString());
	 * if(list!=null && list.size()>0){ for (TblNbsjQuestionEntity tblNbsjQuestion :
	 * list) { tblNbsjQuestion.setStatus(2);
	 * tblNbsjQuestionService.saveOrUpdate(tblNbsjQuestion); } } }
	 * tblNbsjFactbookService.updateNbsjFactBook(fack); String cyId =
	 * request.getParameter("cyId"); TblCirculation c =
	 * tblCirculationService.get(cyId); c.setCystate(TblCirculation.STATE_FQ);
	 * tblCirculationService.update(c); } catch (Exception e) { e.printStackTrace();
	 * return JsonBean.error(); } return JsonBean.success(); }
	 * 
	 *//**
		 * @Des: 事实确认书 上传附件
		 */
	/*
	 * @RequestMapping(value = "/sjss/ssqrs_upload",produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * ssqrs_upload(HttpServletRequest request,TblNbsjFactbookEntity book) { String
	 * attids = request.getParameter("attids"); try { book =
	 * tblNbsjFactbookService.geTblNbsjFactbook(book.getFactid().toString()); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i]); book.getTblNbsjFactbookatts().add(att); }
	 * } tblNbsjFactbookService.updateNbsjFactBook(book); } catch (Exception e) {
	 * e.printStackTrace(); return JsonBean.error(); } return JsonBean.success(); }
	 * 
	 * @RequestMapping(value = "/sjss/confirmation_detail") public ModelAndView
	 * confirmation_detail(HttpServletRequest request, String factid) { //
	 * logger.info("内部审计--审计事实--跳转事实确认书详情页面"); ModelAndView mv = new ModelAndView();
	 * TblNbsjProjectEntity selectProject = new TblNbsjProjectEntity();
	 * TblNbsjFactbookEntity factbook = null; List<TblAttachmentEntity> factAtt =
	 * null; pageBean.setRecordList(new ArrayList<>()); if
	 * (StringUtils.isNotBlank(factid)) { factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid); String pageNumber =
	 * request.getParameter("pageNumber"); if (factbook != null &&
	 * factbook.getTblNbsjProject() != null &&
	 * factbook.getTblNbsjProject().getProjectId() != null) { selectProject =
	 * tblnbsjProjectService.getById(factbook.getTblNbsjProject().getProjectId().
	 * toString()); pageBean = tBlNbsjSheetService.findNbsjSheetByFactBookId(factid,
	 * factbook.getTblNbsjProject().getProjectId().toString(), pageNumber == null ?
	 * 1 : Integer.parseInt(pageNumber), 10); } factAtt =
	 * attachmentService.findAttachmentByNbsjFactBook(factid); } else {
	 * selectProject = tblnbsjProjectService.getSelectProject(); }
	 * mv.addObject("factbook", factbook); mv.addObject("factAtt", factAtt);
	 * mv.addObject("pageBean", pageBean); mv.addObject("selectProject",
	 * selectProject); mv.setViewName("nbsj/sjss/confirmation_detail"); return mv; }
	 * 
	 *//**
		 * @Title: expWordFile
		 * @Description: 事实确认书导出word
		 * @param request
		 * @param factid  事实确认书id
		 * @throws
		 */
	/*
	 * @RequestMapping(value = "/sjss/expWordFile1") public void
	 * expWordFile1(HttpServletRequest request, HttpServletResponse response){
	 * String factid = request.getParameter("factid"); TblNbsjProjectEntity
	 * selectProject = new TblNbsjProjectEntity(); TblNbsjFactbookEntity factbook =
	 * null; Map<String, Object> dataMap = new HashMap<String, Object>(); String
	 * fileNameStr = "ssqrs.doc"; if (StringUtils.isNotBlank(factid)) { factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid);//事实确认书 String pageNumber =
	 * request.getParameter("pageNumber"); if (factbook != null &&
	 * factbook.getTblNbsjProject() != null &&
	 * factbook.getTblNbsjProject().getProjectId() != null) { //所属计划 selectProject =
	 * tblnbsjProjectService.getById(factbook.getTblNbsjProject().getProjectId().
	 * toString()); //审计发现 pageBean =
	 * tBlNbsjSheetService.findNbsjSheetByFactBookId(factid,
	 * factbook.getTblNbsjProject().getProjectId().toString(), pageNumber == null ?
	 * 1 : Integer.parseInt(pageNumber), 10); } } else { selectProject =
	 * tblnbsjProjectService.getSelectProject(); } dataMap.put("projectName",
	 * selectProject.getPProjectName()==null?"":selectProject.getPProjectName());//
	 * 项目名称 dataMap.put("projectCode",
	 * selectProject.getProjectCode()==null?"":selectProject.getProjectCode());//
	 * 项目编号 dataMap.put("factcode",
	 * factbook.getFactcode()==null?"":factbook.getFactcode());//事实确认书编号 TblStaff
	 * user = (TblStaff) request.getSession().getAttribute("longUser");
	 * if(factbook.getTblStaffByCreatestaffid().getStaffid()!=null){
	 * dataMap.put("ngr", factbook.getTblStaffByCreatestaffid().getRealname());//拟稿人
	 * }else{ dataMap.put("ngr", user.getRealname());
	 * 
	 * } if(factbook.getTblStaffByFactstaffid()!=null){ dataMap.put("ssqrr",
	 * factbook.getTblStaffByFactstaffid().getRealname());//事实确认人 }else{
	 * dataMap.put("ssqrr", "");//事实确认人 } if(factbook.getCreatetime()!=null){ String
	 * time = new SimpleDateFormat("yyyy-MM-dd").format(factbook.getCreatetime());
	 * dataMap.put("createtime", time);//拟稿时间 }else{ dataMap.put("createtime", "");
	 * } dataMap.put("describe",
	 * factbook.getDescribe()==null?"":factbook.getDescribe());//事实描述
	 * dataMap.put("sheet", pageBean.getRecordList());//审计发现
	 * 
	 * String folderPath =
	 * request.getSession().getServletContext().getRealPath("/WEB-INF/doc"); String
	 * uuid = UUID.randomUUID().toString().trim().replaceAll("-", ""); String
	 * fileName =folderPath+"/"+ uuid+".doc"; ExportDoc exp = new ExportDoc();
	 * exp.createDoc("ssqrs.xml", fileName, dataMap); //导出Word
	 * FileUtil.downLoad(fileName, response, false,fileNameStr);
	 * FileUtil.deleteFile(fileName); }
	 * 
	 *//**
		 * @Title: expWordFile @Description: 事实确认书导出word @param request @param factid
		 *         事实确认书id @throws
		 */
	/*
	 * @RequestMapping(value = "/sjss/expWordFile") public void
	 * expWordFile(HttpServletRequest request, HttpServletResponse response) {
	 * String factid = request.getParameter("factid"); TblNbsjProjectEntity
	 * selectProject = new TblNbsjProjectEntity(); TblNbsjFactbookEntity factbook =
	 * null; Map<String, Object> dataMap = new HashMap<String, Object>(); if
	 * (StringUtils.isNotBlank(factid)) { factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid);// 事实确认书 String pageNumber =
	 * request.getParameter("pageNumber"); if (factbook != null &&
	 * factbook.getTblNbsjProject() != null &&
	 * factbook.getTblNbsjProject().getProjectId() != null) { // 所属计划 selectProject
	 * = tblnbsjProjectService.getById(factbook.getTblNbsjProject().getProjectId().
	 * toString()); // 审计发现 pageBean =
	 * tBlNbsjSheetService.findNbsjSheetByFactBookId(factid,
	 * factbook.getTblNbsjProject().getProjectId().toString(), pageNumber == null ?
	 * 1 : Integer.parseInt(pageNumber), 10); } } else { selectProject =
	 * tblnbsjProjectService.getSelectProject(); } dataMap.put("projectCode",
	 * selectProject.getProjectCode() == null ? "" :
	 * selectProject.getProjectCode());// 项目编码 dataMap.put("projectName",
	 * selectProject.getPProjectName() == null ? "" :
	 * selectProject.getPProjectName());// 项目名称 dataMap.put("factcode",
	 * factbook.getFactcode() == null ? "" : factbook.getFactcode());// 事实确认书编号
	 * TblStaff user = (TblStaff) request.getSession().getAttribute("longUser"); if
	 * (factbook.getTblStaffByCreatestaffid().getStaffid() != null) {
	 * dataMap.put("ngr", factbook.getTblStaffByCreatestaffid().getRealname());//
	 * 拟稿人 } else { dataMap.put("ngr", user.getRealname()); }
	 * dataMap.put("describe", factbook.getDescribe() == null ? "" :
	 * factbook.getDescribe());// 事实确认
	 * 
	 * dataMap.put("sheet", pageBean.getRecordList());// 审计发现
	 * 
	 * String fileNameStr ="事实确认书.doc"; String folderPath =
	 * request.getSession().getServletContext().getRealPath("/WEB-INF/doc"); String
	 * uuid = UUID.randomUUID().toString().trim().replaceAll("-", ""); String
	 * fileName = folderPath + "/" + uuid + ".doc"; ExportDoc exp = new ExportDoc();
	 * exp.createDoc("ssqrs.xml", fileName, dataMap); // 导出Word
	 * FileUtil.downLoad(fileName, response, false, fileNameStr);
	 * FileUtil.deleteFile(fileName); }
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_add") public ModelAndView
	 * ssqrs_add(HttpServletRequest request, TblNbsjFactbookEntity nbsjFactbook,
	 * 
	 * @RequestParam(value="questionIds", required = false) String[] questionIds) {
	 * // logger.info("内部审计--审计事实--事实确认书添加"); TblNbsjProjectEntity nbsjProject =
	 * this.tblnbsjProjectService.getSelectProject(); //保存附件 if
	 * (nbsjFactbook.getFactid() != null) { TblNbsjFactbookEntity factbook =
	 * this.tblNbsjFactbookService.geTblNbsjFactbook(nbsjFactbook.getFactid().
	 * toString()); //book.getTblNbsjFactbookatts().add(a);
	 * nbsjFactbook.setTblNbsjFactbookatts(factbook.getTblNbsjFactbookatts());
	 * nbsjFactbook.setTblNbsjQuestionaffirms(factbook.getTblNbsjQuestionaffirms());
	 * nbsjFactbook.setCreatetime(factbook.getCreatetime());
	 * nbsjFactbook.setUpdatetime(new Date()); String attids =
	 * request.getParameter("attids"); if (StringUtils.isNotBlank(attids)){ String[]
	 * ids = attids.split(","); for (int i = 0; i < ids.length; i++) {
	 * TblAttachmentEntity att = attachmentService.findById(ids[i].trim());
	 * nbsjFactbook.getTblNbsjFactbookatts().add(att); } } for (int i = 0; i <
	 * questionIds.length; i++) { //questionIds[i] //TBlNbsjSheet tBlNbsjSheet =
	 * tBlNbsjSheetService.get(new BigDecimal(questionIds[i]));
	 * //tblNbsjQuestionaffirmService.deleteTblNbsjQuestionaffirm(tBlNbsjSheet.
	 * getQuestions().get(0).toString(), nbsjFactbook.getFactid().toString());
	 * tblNbsjQuestionaffirmService.deleteTblNbsjQuestionaffirmBySql(questionIds[i],
	 * nbsjProject.getProjectId().toString(), nbsjFactbook.getFactid().toString());
	 * } tblNbsjFactbookService.merge(nbsjFactbook); } else {
	 * nbsjFactbook.setCreatetime(new Date()); nbsjFactbook.setUpdatetime(new
	 * Date()); String attids = request.getParameter("attids"); if
	 * (StringUtils.isNotBlank(attids)){ String[] ids = attids.split(","); for (int
	 * i = 0; i < ids.length; i++) { TblAttachmentEntity att =
	 * attachmentService.findById(ids[i].trim());
	 * nbsjFactbook.getTblNbsjFactbookatts().add(att); } } try {
	 * tblNbsjFactbookService.addNbsjFactBook(nbsjFactbook); } catch (Exception e) {
	 * e.printStackTrace(); } } //关联审计发现 for (int i = 0; i < questionIds.length;
	 * i++) { TblNbsjQuestionaffirmEntity nq = new TblNbsjQuestionaffirmEntity();
	 * nq.setTblNbsjFactbook(nbsjFactbook); TblNbsjQuestionEntity n = new
	 * TblNbsjQuestionEntity(); n.setQuestionId(Integer.valueOf(questionIds[i]));
	 * nq.setTblNbsjQuestion(n);
	 * tblNbsjQuestionaffirmService.saveTblNbsjQuestionaffirm(nq); } return
	 * confirmation_add(request, nbsjFactbook.getFactid().toString()); }
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_tz_add") public ModelAndView
	 * ssqrs_tz_add(HttpServletRequest request, TblNbsjFactbookEntity nbsjFactbook)
	 * { // logger.info("内部审计--审计事实--事实确认书-调整-保存"); if (nbsjFactbook.getFactid() !=
	 * null) { TblNbsjFactbookEntity factbook =
	 * this.tblNbsjFactbookService.geTblNbsjFactbook(nbsjFactbook.getFactid().
	 * toString()); TblNbsjProjectEntity nbsjProject =
	 * this.tblnbsjProjectService.getSelectProject();
	 * //book.getTblNbsjFactbookatts().add(a);
	 * nbsjFactbook.setTblNbsjFactbookatts(factbook.getTblNbsjFactbookatts());
	 * nbsjFactbook.setTblNbsjQuestionaffirms(factbook.getTblNbsjQuestionaffirms());
	 * nbsjFactbook.setCreatetime(factbook.getCreatetime());
	 * nbsjFactbook.setUpdatetime(new Date());
	 * nbsjFactbook.setTblNbsjProject(nbsjProject);
	 * nbsjFactbook.setStatus(factbook.getStatus());
	 * nbsjFactbook.setFhStaffid(factbook.getFhStaffid());
	 * nbsjFactbook.setTblStaffByFactstaffid(factbook.getTblStaffByFactstaffid());
	 * tblNbsjFactbookService.merge(nbsjFactbook); } else {
	 * nbsjFactbook.setCreatetime(new Date()); try {
	 * tblNbsjFactbookService.addNbsjFactBook(nbsjFactbook); } catch (Exception e) {
	 * e.printStackTrace(); } } return project_plan_listdp(request,null); }
	 *//**
		 * @Des: 审计 事实确认书审批
		 */

	/*
	 * @RequestMapping(value = "/sjss/ssqrs_sp" ,produces =
	 * "application/json; charset=utf-8") public @ResponseBody String
	 * ssqrs_sp(HttpServletRequest request, TblNbsjFactbookEntity nbsjFactbook) { //
	 * logger.info("内部审计--审计事实--事实确认书审批"); TblNbsjFactbookEntity factbook =
	 * this.tblNbsjFactbookService.geTblNbsjFactbook(nbsjFactbook.getFactid().
	 * toString()); //添加审计发现、附件
	 * nbsjFactbook.setTblNbsjFactbookatts(factbook.getTblNbsjFactbookatts());
	 * nbsjFactbook.setTblNbsjQuestionaffirms(factbook.getTblNbsjQuestionaffirms());
	 * nbsjFactbook.setCreatetime(factbook.getCreatetime());
	 * nbsjFactbook.setStatus(TblNbsjFactbookEntity.STATUS_2);
	 * tblNbsjFactbookService.merge(nbsjFactbook); TblStaff user = (TblStaff)
	 * request.getSession().getAttribute("longUser"); TblCirculation cir =
	 * tblCirculationService.saveTblCirculation(TblCirculation.TYPE_SSQRS,
	 * nbsjFactbook.getFactcode(), factbook.getTblNbsjProject().getPProjectName(),
	 * TblCirculation.URL_SSQRS + nbsjFactbook.getFactid(), user.getStaffid());
	 * AgentEntity ae = new AgentEntity();
	 * ae.setProjectPerson(nbsjFactbook.getFhStaffid().getStaffid().toString());
	 * ae.setResponsible(nbsjFactbook.getTblStaffByFactstaffid().getStaffid().
	 * toString()); try {
	 * processService.start(ProcessEnum.SJ_SSQRS.name(),user,cir); } catch
	 * (Exception e) { tblCirculationService.delTblCirculation(cir);
	 * e.printStackTrace(); return JsonBean.error(); } return JsonBean.success(); }
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_del") public
	 * 
	 * @ResponseBody String ssqrs_add(HttpServletRequest request, String[] ids) { //
	 * logger.info("内部审计--审计事实--事实确认书删除"); String str = ""; try { for (int i = 0; i
	 * < ids.length; i++) { TblNbsjFactbookEntity factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(ids[i]);
	 * tblNbsjFactbookService.delNbsjFactBook(factbook); } str = "ok"; } catch
	 * (Exception e) { str = "no"; } return str; }
	 * 
	 * @SuppressWarnings("unchecked")
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_addfj") public ModelAndView
	 * ssqrs_addfj(HttpServletRequest request, MultipartFile file, String factid) {
	 * // logger.info("内部审计--审计事实--事实确认书添加附件"); TblStaff user = (TblStaff)
	 * request.getSession().getAttribute("longUser"); //String path =
	 * request.getSession().getServletContext().getRealPath("/WEB-INF/upload/ssqrs/"
	 * ); String fileName = file.getOriginalFilename(); long timeInMillis =
	 * Calendar.getInstance().getTimeInMillis(); String oldname =
	 * fileName.substring(0,fileName.lastIndexOf(".")); String
	 * newname=fileName.replace(oldname, timeInMillis+"sjss"); long size =
	 * file.getSize(); try { boolean flag = FtpUtil.uploadFile(newname,
	 * file.getInputStream()); if(flag){ // logger.info("上传成功"); }else{ //
	 * logger.info("上传失败"); } } catch (Exception e) { e.printStackTrace(); } try {
	 * TblAttachmentEntity a = new TblAttachmentEntity(); a.setAttname(fileName);
	 * a.setAttpath(newname); a.setAttsize(new BigDecimal(size / 1024));
	 * a.setUploader(user.getUsername()); a.setUploadtime(new Date());
	 * attachmentService.add(a); TblNbsjFactbookEntity book =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid);
	 * book.getTblNbsjFactbookatts().add(a);
	 * tblNbsjFactbookService.updateNbsjFactBook(book); } catch (Exception e) { //
	 * logger.error("内部审计--审计事实--事实确认书文件上传失败"); } return confirmation_add(request,
	 * factid); }
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_delfj") public ModelAndView
	 * ssqrs_delfj(HttpServletRequest request, String attid, String factid) { //
	 * logger.info("内部审计--审计事实--事实确认书--附件删除"); TblNbsjFactbookEntity factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid); TblAttachmentEntity att =
	 * attachmentService.findById(attid);
	 * factbook.getTblNbsjFactbookatts().remove(att);
	 * tblNbsjFactbookService.updateNbsjFactBook(factbook); return
	 * confirmation_add(request, factid); }
	 * 
	 * @RequestMapping(value = "/sjss/sp_ssqrs_delfj") public @ResponseBody String
	 * ssqrs_sp_delfj(HttpServletRequest request, String attid, String factid) { //
	 * logger.info("内部审计--审计事实--审批--事实确认书--附件删除");
	 * 
	 * TblNbsjFactbookEntity factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid); TblAttachmentEntity att =
	 * attachmentService.findById(attid); boolean flag =
	 * factbook.getTblNbsjFactbookatts().remove(att);
	 * tblNbsjFactbookService.updateNbsjFactBook(factbook); // String json = ""; //
	 * List<TblAttachment> fj =
	 * attachmentService.findAttachmentByNbsjFactBook(factid); if(flag){ return
	 * JsonBean.success();
	 * 
	 * if(fj.size()==0){ return JsonBean.success(); }else{ //return
	 * JsonBean.success(fj); }
	 * 
	 * }else{ return JsonBean.error("附件删除失败"); } }
	 * 
	 * 
	 * 
	 * 
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_toaddsjfx") public ModelAndView
	 * ssqrs_toaddsjfx(HttpServletRequest request, String riskAttrbution, String
	 * pmids, String businessAffiliation, String factid) { //
	 * logger.info("内部审计--审计事实--事实确认书--跳转添加审计发现"); ModelAndView mv = new
	 * ModelAndView(); String projectid = request.getParameter("projectid"); String
	 * pageNumber = request.getParameter("pageNumber"); String[] sheetids =
	 * request.getParameterValues("sheetids"); String sheetidsstr=""; sheetidsstr =
	 * StringUtils.join(sheetids, ","); TblNbsjProjectEntity project =
	 * tblnbsjProjectService.getById(projectid); //pageBean =
	 * this.tblNbsjQuestionService.findQuestionByStatus(project.getProjectid(),
	 * pmids, riskAttrbution, businessAffiliation, pageNumber == null ? 1 :
	 * Integer.parseInt(pageNumber), pageBean.getPageSize()); pageBean =
	 * this.tblNbsjQuestionService.findQuestionByStatus(project.getProjectId(),
	 * pmids, riskAttrbution, businessAffiliation, pageNumber == null ? 1 :
	 * Integer.parseInt(pageNumber), pageBean.getPageSize(),factid,sheetidsstr);
	 * mv.addObject("pageBean", pageBean); mv.addObject("project", project);
	 * mv.addObject("factid", factid); String cyId = request.getParameter("cyId");
	 * if (StringUtils.isNotEmpty(cyId)){ TblCirculation cy =
	 * tblCirculationService.get(cyId); mv.addObject("cy",cy);
	 * mv.addObject("tId",request.getParameter("tId")); }
	 * mv.setViewName("nbsj/wdcx/ssqrs_question_list"); //查询框代码 String choiceSearch
	 * = request.getParameter("choiceSearch"); if(choiceSearch == null ||
	 * "".equals(choiceSearch)) { choiceSearch = "hide"; }
	 * mv.addObject("choiceSearch",choiceSearch); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_addsjfx") public
	 * 
	 * @ResponseBody String ssqrs_addsjfx(HttpServletRequest request, String factid,
	 * String[] questionIds) { // logger.info("内部审计--审计事实--事实确认书--添加审计发现"); String
	 * str = "ok"; try { for (int i = 0; i < questionIds.length; i++) {
	 * TblNbsjQuestionaffirmEntity nq = new TblNbsjQuestionaffirmEntity();
	 * TblNbsjFactbookEntity factbook = new TblNbsjFactbookEntity();
	 * //factbook.setFactid(new BigDecimal(factid));
	 * nq.setTblNbsjFactbook(factbook); TblNbsjQuestionEntity n = new
	 * TblNbsjQuestionEntity(); n.setQuestionId(Integer.valueOf(questionIds[i]));
	 * nq.setTblNbsjQuestion(n);
	 * tblNbsjQuestionaffirmService.saveTblNbsjQuestionaffirm(nq); } } catch
	 * (Exception e) { str = "no"; // logger.info("内部审计--审计事实--事实确认书--添加审计发现失败"); }
	 * return str; }
	 * 
	 * @RequestMapping(value = "/sjss/ssqrs_delsjfx") public ModelAndView
	 * ssqrs_delsjfx(HttpServletRequest request, String[] sheetids, String factid) {
	 * // logger.info("内部审计--审计事实--事实确认书--删除审计发现"); String projectid =
	 * request.getParameter("tblNbsjProject.projectid"); TblNbsjProjectEntity
	 * project = tblnbsjProjectService.getSelectProject(); TblNbsjFactbookEntity
	 * factbook = tblNbsjFactbookService.geTblNbsjFactbook(factid); if (factbook !=
	 * null && factbook.getTblNbsjProject() != null &&
	 * factbook.getTblNbsjProject().getProjectId() != null) { project =
	 * tblnbsjProjectService.getById(factbook.getTblNbsjProject().getProjectId().
	 * toString()); } if(projectid==null || projectid.equals("")){
	 * projectid=project.getProjectId().toString(); } for (int i = 0; i <
	 * sheetids.length; i++) {
	 * //tblNbsjQuestionaffirmService.deleteTblNbsjQuestionaffirmBySql(sheetids[i],
	 * projectid, factid);
	 * tblNbsjQuestionaffirmService.deleteTblNbsjQuestionaffirm(sheetids[i],
	 * factid); } String cyId = request.getParameter("cyId"); if
	 * (StringUtils.isNotEmpty(cyId)){ return to_sp_ssqrs(request, new
	 * BigDecimal(factid)); }else { return confirmation_add(request, factid); }
	 * 
	 * }
	 * 
	 * @SuppressWarnings("deprecation")
	 * 
	 * @RequestMapping(value = "sjss/expdoc") public
	 * 
	 * @ResponseBody String expdoc(HttpServletRequest request, String factid) { //
	 * logger.info("内部审计--审计事实--事实确认书--导出"); TblNbsjFactbookEntity factbook =
	 * tblNbsjFactbookService.geTblNbsjFactbook(factid); TblNbsjProjectEntity
	 * selectProject = new TblNbsjProjectEntity(); if (factbook != null &&
	 * factbook.getTblNbsjProject() != null &&
	 * factbook.getTblNbsjProject().getProjectId() != null) { selectProject =
	 * tblnbsjProjectService.getById(factbook.getTblNbsjProject().getProjectId().
	 * toString()); pageBean = tBlNbsjSheetService.findNbsjSheetByFactBookId(factid,
	 * factbook.getTblNbsjProject().getProjectId().toString(), 1, 10); } //
	 * 第一步，创建一个webbook，对应一个Excel文件 HSSFWorkbook wb = new HSSFWorkbook(); //
	 * 第二步，在webbook中添加一个sheet,对应Excel文件中的sheet HSSFSheet sheet =
	 * wb.createSheet("事实确认书"); // 第三步，在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
	 * HSSFRow row = sheet.createRow((int) 0); // 第四步，创建单元格，并设置值表头 设置表头居中
	 * HSSFCellStyle style = wb.createCellStyle();
	 * style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式 HSSFCell cell =
	 * row.createCell((short) 0); cell.setCellValue("项目名称");
	 * cell.setCellStyle(style); cell = row.createCell((short) 1);
	 * cell.setCellValue("项目编码"); cell.setCellStyle(style); cell =
	 * row.createCell((short) 2); cell.setCellValue("确认书编号");
	 * cell.setCellStyle(style); cell = row.createCell((short) 3);
	 * cell.setCellValue("事实确认人"); cell.setCellStyle(style); cell =
	 * row.createCell((short) 4); cell.setCellValue("拟稿人");
	 * cell.setCellStyle(style); cell = row.createCell((short) 5);
	 * cell.setCellValue("拟稿时间"); cell.setCellStyle(style); cell =
	 * row.createCell((short) 6); cell.setCellValue("拟稿人意见");
	 * cell.setCellStyle(style); // 第五步，写入实体数据 实际应用中这些数据从数据库得到，
	 * 
	 * for (int i = 0; i < list.size(); i++) { row = sheet.createRow((int) i + 1);
	 * Student stu = (Student) list.get(i); // 第四步，创建单元格，并设置值 row.createCell((short)
	 * 0).setCellValue((double) stu.getId()); row.createCell((short)
	 * 1).setCellValue(stu.getName()); row.createCell((short)
	 * 2).setCellValue((double) stu.getAge()); cell = row.createCell((short) 3);
	 * cell.setCellValue(new SimpleDateFormat("yyyy-mm-dd").format(stu
	 * .getBirth())); }
	 * 
	 * // 第六步，将文件存到指定位置 try { FileOutputStream fout = new
	 * FileOutputStream("E:/students.xls"); wb.write(fout); fout.close(); } catch
	 * (Exception e) { e.printStackTrace(); } return "ok"; }
	 * 
	 * @RequestMapping(value = "/sjss/select_question_add_2") public ModelAndView
	 * select_question_add_2() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjss/select_question_add_2"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/select_question_add_3") public ModelAndView
	 * select_question_add_3() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjss/select_question_add_3"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/confirmation_edit") public ModelAndView
	 * confirmation_edit() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjss/confirmation_edit"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/confirmation_flow_list") public ModelAndView
	 * confirmation_flow_list() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjss/confirmation_flow_list"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/index_confirmation_trackback") public
	 * ModelAndView index_confirmation_trackback() { ModelAndView mv = new
	 * ModelAndView(); mv.setViewName("nbsj/sjss/index_confirmation_trackback");
	 * return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/head_confirmation") public ModelAndView
	 * head_confirmation() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjss/head_confirmation"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjss/confirmation_detail_2") public ModelAndView
	 * confirmation_detail_2() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjss/confirmation_detail_2"); return mv; }
	 * 
	 * @RequestMapping(value = "/zyk/external_office") public ModelAndView
	 * external_office() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/zyk/external_office"); return mv; }
	 * 
	 * @RequestMapping(value = "/zyk/external_specialist") public ModelAndView
	 * external_specialist() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/zyk/external_specialist"); return mv; }
	 * 
	 * @RequestMapping(value = "/zyk/inner_specialist") public ModelAndView
	 * inner_specialist() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/zyk/inner_specialist"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjyj/alert_my_list") public ModelAndView
	 * alert_my_list() { ModelAndView mv = new ModelAndView();
	 * mv.setViewName("nbsj/sjyj/alert_my_list"); return mv; }
	 * 
	 * @RequestMapping(value = "/sjyj/case_my") public ModelAndView case_my() {
	 * ModelAndView mv = new ModelAndView(); mv.setViewName("nbsj/sjyj/case_my");
	 * return mv; }
	 * 
	 *//**
		 * 整改分派-方案
		 *//*
			 * @RequestMapping(value = "/sjzg/question_allocate_list") public ModelAndView
			 * question_allocate_listZggz(BigDecimal orgId, String solutioncode, Integer
			 * pageNumber,HttpServletRequest request) { TblStaff tblStaff = (TblStaff)
			 * request.getSession().getAttribute("longUser"); pageBean =
			 * tblNbsjReformSolutionService.findAllByUserid(tblStaff.getStaffid().toString()
			 * , solutioncode, pageNumber, pageBean.getPageSize()); ModelAndView mv = new
			 * ModelAndView("nbsj/sjzg/zgfp_solutionmgmt"); mv.addObject("orgId", orgId);
			 * mv.addObject("pageBean", pageBean); mv.addObject("view",
			 * request.getParameter("view")); mv.addObject("solutioncode", solutioncode);
			 * //查询框代码 String choiceSearch = request.getParameter("choiceSearch");
			 * if(choiceSearch == null || "".equals(choiceSearch)) { choiceSearch = "hide";
			 * } mv.addObject("choiceSearch",choiceSearch); return mv; }
			 * 
			 * @RequestMapping(value = "/wddb/project_plan_list") public ModelAndView
			 * project_plan_listdp(HttpServletRequest request, TblNbsjAuditplanEntity plan)
			 * { Integer pageNumber = 0; TblOrganization attribute1 = (TblOrganization)
			 * request.getSession().getAttribute("hbOrgEntity");// 当前用户的机构
			 * 
			 * String number = request.getParameter("pageNumber"); if (number != null &&
			 * number.length() > 0) { pageNumber = Integer.parseInt(number); } TblStaff user
			 * = (TblStaff) request.getSession().getAttribute("longUser"); pageBean = new
			 * PageBean(); try { pageBean =
			 * processService.todoList(user,pageNumber,pageBean.getPageSize(),attribute1.
			 * getOrgname()); } catch (Exception e) { e.printStackTrace(); } ModelAndView mv
			 * = new ModelAndView(); mv.addObject("pageBean",pageBean);
			 * mv.setViewName("nbsj/sjgl/wd_project_plan_list"); return mv; }
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * /**
			 * 
			 * @Author: TYB
			 * 
			 * @Date: 2017-04-10 下午 1:19
			 * 
			 * @Des: 后台报错跳转error页时传递提示 data:001:未选择项目 002:项目未添加指引模板
			 */
	public void setErrorJsp(String data, HttpServletRequest request) {
		request.getSession().removeAttribute("ErrorJsp");
		request.getSession().setAttribute("ErrorJsp", data);
	}
}
